我想检查我的数据库中是否存在电子邮件,然后根据返回的值执行进一步的语句......我的代码如下......
private void deleterecordbutton_Click(object sender, EventArgs e)
{
if (deleterecordtextBox.Text != "")
{
MyOleDbConnection.Open();
string vsql = string.Format("delete from login where Email='{0}'", deleterecordtextBox.Text);
OleDbCommand vcom = new OleDbCommand(vsql, MyOleDbConnection.vcon);
vcom.ExecuteNonQuery();
MessageBox.Show("Record deleted successfully!!");
MyOleDbConnection.Close();
deleterecordtextBox.Clear();
this.Close();
this.ReferToLogindb.Show();
}
else
{
MessageBox.Show("No record selected");
}
}