我需要将DataTable
Microsoft Access 中的 a 加载到DataSet
using 中OleDb
。我需要将其加载DataSet
到DataGridView
. 然后,我需要对Microsoft AccessDataGridView
中的原始文件进行更改并更新这些更改。DataTable
到目前为止,这是我的代码:
Public tblName As String = "Criteria"
Dim ds As New DataSet()
Dim da As OleDbDataAdapter
Dim cmdBuilder As OleDbCommandBuilder
Dim Bsource As New BindingSource
Public Sub Show_Panel_Manage_Calculations()
Panel_Manage_Calculations.Show()
Nordeen_Investing_3.con.Open()
da = New OleDbDataAdapter("SELECT Calculation, [Interval], Formula FROM " & tblName & "", Nordeen_Investing_3.con)
cmdBuilder = New OleDbCommandBuilder(da)
da.Fill(ds, "Criteria")
Bsource.DataSource = ds
DataGridView_Manage_Calculations.DataSource = Bsource
Nordeen_Investing_3.con.Close()
End Sub
Private Sub Button_Update_Click(sender As Object, e As EventArgs) Handles Button_Update.Click
Nordeen_Investing_3.con.Open()
da.Update(ds, "Criteria")
Nordeen_Investing_3.con.Close()
End Sub
现在我的数据DataTable
没有显示在我的DataGridView
.