DataGridView
在对被叫进行更改后,我需要更新我的 Access 数据库DataGridView_Manage_Calculations
,然后单击Button
被叫Button_Update
。
这是我到目前为止的代码:
Dim dtManage As New DataTable
Dim ManageAdapter As OleDbDataAdapter
Dim Bsource As New BindingSource
Public Sub Show_Panel_Manage_Calculations()
Panel_Manage_Calculations.Show()
ManageAdapter = New OleDbDataAdapter("Select Calculation, [Interval], Formula From " & tblName & "", con)
dtManage.Clear()
ManageAdapter.Fill(dtManage)
Bsource.DataSource = dtManage
DataGridView_Manage_Calculations.DataSource = Bsource
End Sub
Private Sub Button_Update_Click(sender As Object, e As EventArgs) Handles Button_Update.Click
Dim ObjComander As New OleDbCommandBuilder(ManageAdapter)
ManageAdapter.Update(dtManage)
End Sub
我收到此错误:Syntax error in INSERT INTO statement.
我究竟做错了什么?
附加信息
Public Sub createTable_Criteria()
Dim cmd As New OleDb.OleDbCommand("CREATE TABLE " & tblName & "(" & "Calculation Text(10) NOT NULL," & "[Interval] Text NOT NULL," & "Formula Text," & "Tier_Juncture_1 Integer," & "Tier_Juncture_2 Integer," & "Tier_Juncture_3 Integer," & "Weight Integer, CONSTRAINT pk_Calculation PRIMARY KEY (Calculation, [Interval]));", con)
cmd.ExecuteNonQuery()
End Sub