我在用着:
string insertQ = "insert into Customer(Name, CNIC, Address, Balance) values(@name, @cnic, @address, @balance); SELECT CAST(scope_identity() AS int);";
SqlCommand insertCmd1 = new SqlCommand(insertQ, con);
Int32 newId = (Int32)insertCmd1.ExecuteScalar();
但
“必须声明标量变量”
异常来了ExecuteScalar
。
请告诉我如何解决它...