saifullah khan

saifullah khan

  • NA
  • 335
  • 301.1k

update database table

Jun 2 2011 1:39 AM
Hi!
   i want to update my database table on button click event. here is the query.

protected void Button4_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = new SqlCommand("update Arrear set ConsumerNo=" + ConsumerNo.Text + ",WaterCharges='" + WaterCharges.Text + "',SaverageCharges='" + SaverageCharges.Text + "',ConservancyCharges='" + SaverageCharges.Text + "',arear='" + arear.Text + "' where ConsumerNo=" + ConsumerNo.Text, con);
con.Close();
}

but it does not update the table. please tell me what is the problem

Answers (6)