sql - `Must declar Scalar variable at...` Can someone explain exactly what this is? -
sql - `Must declar Scalar variable at...` Can someone explain exactly what this is? -
can help me declaring scalar variable? don't understand scalar variable
declaration.
below code causing exception.
int customer_id; int.tryparse(customer_idtextbox1.text, out customer_id); string sql = @"update client set customer_name = @customer_name customer_id = @customer_id"; sqlcommand sqlcommand = new sqlcommand(sql, sqlconnection); sqlcommand.parameters.addwithvalue("@customer_name", customer_name); sqlconnection.open(); sqlcommand.executenonquery();
you have @customer_name
variable declared parameter. add together line
sqlcommand.parameters.addwithvalue("@customer_id", customer_id);
under current addwithvalue
line.
sql
Comments
Post a Comment