使用绑定导航器删除数据库中的记录
您好,我使用绑定导航器进行导航并抛出了数据网格视图。该 datagridview 与数据库连接。 如果我想删除 datagridview 上的一行,那么它会完美删除它,但数据库中的行会保留。
private void deletetoolStripButton_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Delete record?", "Confirm", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
{
//bindingSource1.RemoveCurrent();
DataGridView1.Rows.Remove(DataGridView1.CurrentRow);
}
}
如何获取记录的具体详细信息以将参数发送到数据库并使用我的下一个函数真正删除记录?
deleteRecordDataGridView(parameter);
Hi I navigate with a bindingnavigator threw a datagridview. this datagridview is connected with a database.
If I want to delete a row on the datagridview then it deletes it perfectly, But the row in the database stays.
private void deletetoolStripButton_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Delete record?", "Confirm", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
{
//bindingSource1.RemoveCurrent();
DataGridView1.Rows.Remove(DataGridView1.CurrentRow);
}
}
How to fetch the record specific details for sending a parameter to the database and delete the record for real with my next function ?
deleteRecordDataGridView(parameter);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系,我是这样解决的
Never mind I solved it like this