如何解决这段代码跳到 else 语句上
if (EmployeeID > 0)
{
sqlCommand cmd = new sqlCommand("UPDATE EmployeeInfo SET EmpName = @EmpName,Department = @Department,Designation = @Designation WHERE EID = @ID ",con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@EID",txtEmpID.Text);
cmd.Parameters.AddWithValue("@EmpName",txtEmpName.Text);
cmd.Parameters.AddWithValue("@Department",txtDepart.Text);
cmd.Parameters.AddWithValue("@Designation ",txtDesign.Text);
cmd.Parameters.AddWithValue("@ID",this.EmployeeID);
con.open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show(
"Employee information is updated successfully","Saved",MessageBoxButtons.OK,MessageBoxIcon.information);
getemployeerecords();
resetfunction();
}
else
{
MessageBox.Show(
"Please select employee to update","Select",MessageBoxIcon.Error);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。