删除数据库的记录
1、添加数据库文件都bin\debug\目录下
2、连接数据库
3、编程实现数据删除
具体代码如下:
private void button1_Click(object sender, EventArgs e)
{
mycon.Open();
string myupdate = "delete from mydata where ID ="+Convert.ToInt32(pstr)+ "";
OleDbCommand mycom = new OleDbCommand(myupdate, mycon);
mycom.ExecuteNonQuery();
mycon.Close();
Showdata();
MessageBox.Show("已成功修改该条数据库记录信息!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}