以下のコードを使用して asp.net ページからローカル データベースにデータを挿入しようとしていますが、このエラーが発生し続けます
「キーワード 'user' 付近の構文が正しくありません」
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("<b>something really bad happened.....Please try again</b> ");
}
}