2
Answers

working with windows forms

rashi bansal

rashi bansal

15y
2.1k
1
i m inserting values to database using executeNonQuery on debugging its working but changes r not reflected to database private void BtnCommit_Click(object sender, EventArgs e) {//dekho int amtwith = Convert.ToInt32(txtAmount.Text.Trim()); int bal = Balance() - amtwith; con.Open(); SqlCommand cmd = new SqlCommand("update balance set bal=@bal where cardno=@cno", con); cmd.Parameters.AddWithValue("@bal", bal); cmd.Parameters.AddWithValue("@cno",this.CardNo); cmd.ExecuteNonQuery(); balance is Rs." + bal); con.Close(); }

Answers (2)