Hey,
Id'd put a try catch around the whole statement in Button2_Click and see if any exceptions were thrown.
Also its good coding practice to wrap any classes which implement IDisposable in using statements so your method would become:
using (conn)
{
conn.Open();
using (SqlTransaction objTrans = conn.BeginTransaction())
{
try
{
using (SqlCommand cmd1 = new SqlCommand("UPDATE tbl_emp SET password=@password, Address=@Address WHERE email=@email", conn))
{
cmd1.Parameters.AddWithValue("@password", "");
cmd1.Parameters.AddWithValue("@Address", "");
cmd1.Parameters.AddWithValue("@email", "");
cmd1.ExecuteNonQuery();
objTrans.Commit();
}
}
catch (SqlException ex)
{
objTrans.Rollback();
}
Label1.Text " Data Updates Succesfully on " + System.DateTime.Now.ToShortDateString();
}
}
Also I would wrap the update in a transaction just to be safe, apologies if there are some syntax mistakes as I wrote it free hand but you get the idea.