Cris Abella

Cris Abella

  • NA
  • 6
  • 2.8k

Update to MSSQL database failed.

Jan 31 2014 8:33 AM
Hello everybody please consider me as a newbie in C# and I am much willing to learn this language. This is first time I've join the community.
 
why update to mssql database failed.
mssql table
custId = int(autoincrement)
custname = varchar(30) 
 
SqlConnection con = new SqlConnection("Data Source=CRIS-PC\\SQLEXPRESS;Integrated Security=True;Initial Catalog = POS");
SqlCommand command = new SqlCommand("Update customers set custname = @custname where custid = @custId)", con);
command.Parameters.AddWithValue("@custname",txtName.Text);
command.Parameters.AddWithValue("@custId",Convert.ToInt32(txtCustId.Text));
thank in advance. 
Cris 
 
 
 

Answers (3)