protected void Button2_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { MessageBox.alert("No deje el campo vacio"); } else { Estudiantes ObjEstudiante = new Estudiantes(); GridView1.DataBind(); try { bool respuestaSQL = ObjEstudiante.CambiarEstado(TextBox1.Text); if (respuestaSQL == true) { TextBox6.Text = ""; TextBox18.Text = ""; TextBox19.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox5.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox18.Text = ""; Label12.Text = ""; Label1.Text = ""; Label2.Text = ""; Label3.Text = ""; Label4.Text = ""; Label5.Text = ""; Label6.Text = ""; Label7.Text = ""; Label8.Text = ""; Label9.Text = ""; Label10.Text = ""; Label11.Text = ""; MessageBox.alert("El estudiante ha cambiado su estado a inactivo correctamente"); } else { MessageBox.alert(ObjEstudiante.Mensaje); } } catch (Exception Ex) { MessageBox.alert("Error!: " + Ex.Message + " " + ObjEstudiante.Mensaje); } } }