Thanks for the help in advance.
Im trying to use update query in C#
command is getting executed even if I use incorrect values is given.
Instead giving error . It shows command successful.
Pls find the code
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- con.Open();
- cmd = new SqlCommand("update Comcast_AvayaID set Status='Inactive' where Employee_Id='" + TxtEMPID.Text + "' and AvayaID ='" + TxtAvayaID.Text + "'", con);
- cmd = new SqlCommand("UPDATE Avaya_Id SET Status = 'UnAssigned' where Avaya_ID ='" + TxtAvayaID.Text + "'", con);
- cmd.ExecuteNonQuery();
- LBLSuccess.Visible = true;
- LBLSuccess.Text = "Deactivation Successfull";
- con.Close();
- }
- catch (SqlException ex)
- {
- LBLSuccess.Visible = true;
- LBLSuccess.Text = "Deactivation Unsuccessfull";
- }