title: inserting data into database using asp.net c#
body: <p>Am trying to insert data into a local database from an asp.net page using the code below but i keep getting this error </p>
  
  <blockquote>
    <p>"Incorrect syntax near the keyword 'user'"</p>
  </blockquote>
  
  <pre><code> protected void Button1_Click(object sender, EventArgs e)
      {
          SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString);
          con.Close();
          string inse = "insert into user (username, password, emailadd, fullname, country) values(@username, @password, @emailadd, @fullname, @country) ";
          SqlCommand insertuser = new SqlCommand(inse, con);
          insertuser.Parameters.AddWithValue("@username",TextBoxFA.Text);
          insertuser.Parameters.AddWithValue("@password", TextBoxEA.Text);
          insertuser.Parameters.AddWithValue("@emailadd", TextBoxRPW.Text);
          insertuser.Parameters.AddWithValue("@fullname", TextBoxPW.Text);
          insertuser.Parameters.AddWithValue("@country",DropDownList1.SelectedItem.ToString());
  
          try
          {
              insertuser.ExecuteNonQuery();
              con.Close();
              Response.Redirect("login.aspx");
          }
          catch (Exception ex)
          {
              Response.Write("&lt;b&gt;something really bad happened.....Please try again&lt;/b&gt; ");
          }
      }
  </code></pre>