I have this update statement but in updating the database:
SqlCommand cmd = new SqlCommand("UPDATE classresult SET English = " + Eng.Text + ", Kiswahili=" + Kisw.Text + ", Maths=" + Maths.Text + ", Bilogy=" + Bio.Text + ", Physics=" + Phy.Text + ", Chemistry=" + Chem.Text + ", Geo=" + Geo.Text + ", History=" + Hist.Text + ", Agricture=" + Agric.Text + ", bussines =" + Buss.Text + ", RE=" + RE.Text + " WHERE admno = " + tbadmno.Text + "", con);
cmd.CommandType = CommandType.Text;
try
{
con.Open();
cmd.ExecuteNonQuery();
message = "Data inserted successfully";
con.Close();
}
catch (Exception ex)
{
message = ex.Message;
}
I don't know where the problem even the exception does not execute. please help.
Thanks in Advance.