title: Incorrect syntax near 'nvarchar'. I get this error whenever trying to update a field on a database table using a grid view
body: <p>This is my ASP.net code the query gets all details from the customer table and then in the grid view the user is allowed to edit the fields. Whenever i click update it throws that error then. When researching the problem i seen alot of people where saying about using spaces and [] but i tried the code with no spaces and no brackets but still get the same error. I also tried adding a @ for the parameters in the gridview Please Help.</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="&lt;%$ ConnectionStrings:BookConnString %&gt;" DeleteCommand="DELETE FROM Customer WHERE Email = @original_Email AND (([First Name] = @original_First_Name) OR ([First Name] IS NULL AND @original_First_Name IS NULL)) AND (([Surname] = @original_Surname) OR ([Surname] IS NULL AND @original_Surname IS NULL)) AND (([Address] = @original_Address) OR ([Address] IS NULL AND @original_Address IS NULL)) AND (([Postcode] = @original_Postcode) OR ([Postcode] IS NULL AND @original_Postcode IS NULL)) AND (([Gender] = @original_Gender) OR ([Gender] IS NULL AND @original_Gender IS NULL))" InsertCommand="INSERT INTO Customer ([Email], [First Name], [Surname], [Address], [Postcode], [Gender]) VALUES (@Email, @First_Name, @Surname, @Address, @Postcode, @Gender)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM Customer" UpdateCommand="UPDATE Customer SET [First Name] = @First_Name, [Surname] = @Surname, [Address] = @Address, [Postcode] = @Postcode, [Gender] = @Gender WHERE [Email] = @original_Email AND (([First Name] = @original_First_Name) OR ([First Name] IS NULL AND @original_First_Name IS NULL)) AND (([Surname] = @original_Surname) OR ([Surname] IS NULL AND @original_Surname IS NULL)) AND (([Address] = @original_Address) OR ([Address] IS NULL AND @original_Address IS NULL)) AND (([Postcode] = @original_Postcode) OR ([Postcode] IS NULL AND @original_Postcode IS NULL)) AND (([Gender] = @original_Gender) OR ([Gender] IS NULL AND @original_Gender IS NULL))"&gt;
          &lt;DeleteParameters&gt;
              &lt;asp:Parameter Name="original_Email" Type="String" /&gt;
              &lt;asp:Parameter Name="original_First_Name" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Surname" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Address" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Postcode" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Gender" Type="String" /&gt;
          &lt;/DeleteParameters&gt;
          &lt;InsertParameters&gt;
              &lt;asp:Parameter Name="Email" Type="String" /&gt;
              &lt;asp:Parameter Name="First_Name" Type="String" /&gt;
              &lt;asp:Parameter Name="Surname" Type="String" /&gt;
              &lt;asp:Parameter Name="Address" Type="String" /&gt;
              &lt;asp:Parameter Name="Postcode" Type="String" /&gt;
              &lt;asp:Parameter Name="Gender" Type="String" /&gt;
          &lt;/InsertParameters&gt;
          &lt;UpdateParameters&gt;
              &lt;asp:Parameter Name="First_Name" Type="String" /&gt;
              &lt;asp:Parameter Name="Surname" Type="String" /&gt;
              &lt;asp:Parameter Name="Address" Type="String" /&gt;
              &lt;asp:Parameter Name="Postcode" Type="String" /&gt;
              &lt;asp:Parameter Name="Gender" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Email" Type="String" /&gt;
              &lt;asp:Parameter Name="original_First_Name" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Surname" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Address" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Postcode" Type="String" /&gt;
              &lt;asp:Parameter Name="original_Gender" Type="String" /&gt;
          &lt;/UpdateParameters&gt;
      &lt;/asp:SqlDataSource&gt;
  &lt;/p&gt;
  &lt;p class="auto-style4"&gt;
      &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Email" DataSourceID="SqlDataSource1"&gt;
          &lt;Columns&gt;
              &lt;asp:CommandField ShowEditButton="True" /&gt;
              &lt;asp:BoundField DataField="Email" HeaderText="Email" ReadOnly="True" SortExpression="Email" /&gt;
              &lt;asp:BoundField DataField="First Name" HeaderText="First Name" SortExpression="First Name" /&gt;
              &lt;asp:BoundField DataField="Surname" HeaderText="Surname" SortExpression="Surname" /&gt;
              &lt;asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" /&gt;
              &lt;asp:BoundField DataField="Postcode" HeaderText="Postcode" SortExpression="Postcode" /&gt;
              &lt;asp:BoundField DataField="Gender" HeaderText="Gender" SortExpression="Gender" /&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>