我正在使用此代码添加和编辑员工。首先,我通过验证进行检查,然后将图像添加到数据库中,如果在运行时进行U编辑,则表示显示错误“无法导航到'IF'”。编码有什么问题吗?
private void btn_submit_Click(object sender, EventArgs e)
{
if (employeevalidate() == true)
{
toproperties();
if (cpbempadd.employeesave(cpemp) == true)
{
if (saveImageInDataBase(cpemp.Empid) == true)
{
MessageBox.Show("Employee Details are Saved Sucessfully....");
grid();
pnl_addedit.Visible = false;
pnl_grid.Visible = true;
}
}
}
else
{
MessageBox.Show("Error in Saving Employee Details... ");
}
}
验证编码是:
public bool employeevalidate()
{
if (cpbempadd.textboxnull(txt_empid) == false) { return false; }
if (cpbempadd.textboxnull(txt_empname) == false) { return false; }
if (cpbempadd.textboxnull(txt_mobno) == false) { return false; }
if (cpbempadd.textboxnull(txt_proofdetails) == false) { return false; }
if (cpbempadd.textboxnull(txt_upload) == false) { return false; }
if (txt_add2.Text == string.Empty) { txt_add2.Text = "-"; }
if (txt_add3.Text == string.Empty) { txt_add3.Text = "-"; }
if (txt_bg.Text == string.Empty) { txt_bg.Text = "-"; }
if (txt_email.Text == string.Empty) { txt_email.Text = "-"; }
if (txt_pf.Text == string.Empty) { txt_pf.Text = "-"; }
if (txt_status.Text == string.Empty) { txt_status.Text = "-"; }
return true;
}
答案 0 :(得分:0)
问题已解决..错误在SQL语法中。非常感谢