我使用这个代码片段在我的数据库更新值:更新在ASP.NET
SqlConnection con = new SqlConnection(@"Data Source=SAMA-PC\SQLEXPRESS;Initial Catalog=advCenter;Integrated Security=True");
string str = "[email protected]";
SqlCommand com2 = new SqlCommand("select [user_Account] from User in str where [user_Email][email protected]", con);
SqlCommand com = new SqlCommand("update User set [user_Account]=? WHERE [[email protected]]", con);
com.Parameters.AddWithValue("user_Account",str);
com.Parameters.AddWithValue("@em",str);
con.Open();
com.ExecuteNonQuery();
com2.ExecuteNonQuery();
con.Close();
,但我得到这个错误关键字“用户”附近
不正确的语法。
第40行:com.ExecuteNonQuery();