无法实时刷新
private void toolStripButton4_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection( "server=(local);database=HR;uid=sa;pwd=; ");
try
{
con.Open();
SqlCommand cmd = new SqlCommand( "delete from tb_user where HR_user= ' " + m1 + " ' and HR_password= ' " + m2 + " ' ", con);
cmd.ExecuteNonQuery();
MessageBox.Show( "记录删除成功! ");
}
catch (SqlException ae)
{
MessageBox.Show(ae.Message.ToString());
}
finally
{
con.Close();
}