有人可以帮我宣布一个标量变量吗?我真的不明白这个Scalar Variable宣言.
下面是导致我的异常的代码.
int customer_Id;
int.TryParse(customer_IDTextBox1.Text, out customer_Id);
string SQL = @"UPDATE Customer
SET Customer_Name = @customer_Name
WHERE Customer_ID = @customer_Id";
SqlCommand sqlCommand = new SqlCommand(SQL, sqlConnection);
sqlCommand.Parameters.AddWithValue("@customer_Name", customer_Name);
sqlConnection.Open();
sqlCommand.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud) sql ×1