更新数据集并将其显示回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[^].