更新数据集并将其显示回datagridview [英] Updating a dataset and displaying it back to datagridview

查看:83
本文介绍了更新数据集并将其显示回datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MDSN上找到了一种更新数据集并将其显示回datagridview的方法。几乎就像刷新datagridview一样。但是我希望通过oledpdataadapter找到一种方法。这是我在下面找到的代码,用更新的内容填充datagridview,有一种方法可以用oledbdataadapter做同样的事情。





I found a way on MDSN to update a dataset and display it back to the datagridview. Almost like refreshing the datagridview. However I'm hoping to find a way to do this with an oledpdataadapter. Here is the code I found below to fill the datagridview with the updated contents, there has to be a way to do this same thing with the oledbdataadapter.


this.rscan_queueTableAdapter.Fill(this.rscanDataSet.rscan_queue)
   dgv_queue.refresh()

推荐答案

该代码不更新DGV。它更新了一个DataTable,然后你必须绑定到DGV。



你可以找到一个使用OleDataAdapter的例子此处 [ ^ ]。
That code does not update a DGV. It updates a DataTable, which you then have to bind to a DGV.

You can find an example of using the OleDataAdapter here[^].


这篇关于更新数据集并将其显示回datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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