如何删除一行dgv,然后将其从excel数据库中删除? [英] how to delete a row of dgv and then it deleted from excel Database?

查看:74
本文介绍了如何删除一行dgv,然后将其从excel数据库中删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库是excel.我将数据从excel导入到dgv,但是当我从dgv删除一行时,它不会从excel中删除.
我通过以下代码从dgv中删除行:

My database is excel. I import data from excel to dgv, but when I delete a row from dgv it does not delete it from excel.
I delete row from dgv by this code:

dataGridView1.Rows.Remove(dataGridView1.CurrentRow);

推荐答案

从DataGridView中删除不会自动从中删除数据库.
下面的链接描述了它的运行方式.

尽管Jet OLE DB提供程序允许您在Excel工作簿中插入和更新记录,但它不允许DELETE操作."
- MSDN [
Deleting from DataGridView won''t automatically delete from database anyway.
The link below describes how it goes.

"Although the Jet OLE DB Provider allows you to insert and update records in an Excel workbook, it does not allow DELETE operations."
-MSDN[^]


这篇关于如何删除一行dgv,然后将其从excel数据库中删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆