update data from textBox to DataBase
hello!im trying to update from text box to database. it doesnt work.
this is my code on button click, where im wrong?
cmd = new SqlCommand("update_pro", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@id", SqlDbType.NChar).Value = TextBoxid1.Text;
cmd.Parameters.Add("@fname", SqlDbType.NChar).Value = TextBoxfname1.Text;
cmd.Parameters.Add("@lname", SqlDbType.NChar).Value = TextBoxlname.Text;
cmd.Parameters.Add("@id_num", SqlDbType.NChar.Value = TextBoxid2.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
thank you.