我使用這個代碼片段在我的數據庫更新值:更新在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();