title: ASP.net Syntax error in INSERT INTO statement - cmd.ExecuteNonQuery()
body: <p>Currently doing a project and I am having a serious problem with some code. I keep getting the cmd.ExecuteNonQuery() and i have searched all over the internet to find the solution. I have inserted [] in certain catagories and still produces the same error. </p>
  
  <p>All I am doing is creating a page where people can input data for certain catagories, in which once added, it will be updated to the access database. I had this working on an earlier version but ever since i added more characters, it has come with this error.</p>
  
  <pre><code>&lt;%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="addcar.aspx.vb" Inherits="WebApplication1.addcar" %&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server"&gt;
         &lt;p&gt;
          &lt;br /&gt;
          CarName&lt;asp:TextBox ID="tb_CarName" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
        &lt;p&gt;
          &lt;br /&gt;
          Year&lt;asp:TextBox ID="tb_Year" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
        &lt;p&gt;
          &lt;br /&gt;
          EngineSize&lt;asp:TextBox ID="tb_EngineSize" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
        &lt;p&gt;
          &lt;br /&gt;
          BHP&lt;asp:TextBox ID="tb_BHP" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
        &lt;p&gt;
          &lt;br /&gt;
          Origin&lt;asp:TextBox ID="tb_Origin" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
        &lt;p&gt;
          &lt;br /&gt;
          Description&lt;asp:TextBox ID="tb_Description" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
         &lt;p&gt;
          &lt;br /&gt;
          Pictures&lt;asp:TextBox ID="tb_Pictures" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/p&gt;
           &lt;p&gt;
               &lt;asp:Button ID="Button" runat="server" Text="Add Car Details" /&gt;
      &lt;/p&gt;
     &lt;/asp:Content&gt;
  </code></pre>
  
  <p><strong>Followed by the button code which is:</strong></p>
  
  <pre><code>Imports System.Data.OleDb
  
  Public Class addcar
      Inherits System.Web.UI.Page
  
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
      End Sub
      Protected Sub Button_Click(sender As Object, e As EventArgs) Handles Button.Click
          Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("CarsConnectionString").ConnectionString)
          Dim SqlString As String = "Insert into Table1(CarName,Year,EngineSize,BHP,Origin,Description,Pictures) Values (@f1,@f2,@f3,@f4,@f5,@f6,@f7)"
          Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)
          cmd.CommandType = CommandType.Text
          cmd.Parameters.AddWithValue("@f1", tb_CarName.Text)
          cmd.Parameters.AddWithValue("@f2", tb_Year.Text)
          cmd.Parameters.AddWithValue("@f3", tb_EngineSize.Text)
          cmd.Parameters.AddWithValue("@f4", tb_BHP.Text)
          cmd.Parameters.AddWithValue("@f5", tb_Origin.Text)
          cmd.Parameters.AddWithValue("@f6", tb_Description.Text)
          cmd.Parameters.AddWithValue("@f7", tb_Pictures.Text)
          oleDbConn.Open()
          cmd.ExecuteNonQuery()
          Response.Redirect("confirmation.aspx")
  
  
      End Sub
  
  End Class
  </code></pre>
  
  <p>Help? What am I doing wrong?</p>
  
  <p><strong>Error is as follows:</strong></p>
  
  <blockquote>
    <p>Syntax error in INSERT INTO statement.</p>
  </blockquote>