Sorry I didn't see the command builder.
I actually have never used a tool that generates sql commands for me...I guess I'm a bit of a control freak and like to ensure that the statements are correct by supplying them to my data adapters manually.
Anyway, I took a look at the
OdbcCommandBuilder Class for more information on the class.
Try modifying their code example to suit your needs:
-
Public Function SelectOdbcSrvRows(ByVal connectionString As String, ByVal tableName As String) As DataSet
-
-
Dim queryString As String= "select * from phone order by nm"
-
-
Dim dataSet As DataSet = New DataSet
-
-
Using connection As New OdbcConnection(connectionString)
-
Dim adapter As New OdbcDataAdapter()
-
adapter.SelectCommand = New OdbcCommand(queryString, connection)
-
Dim builder As OdbcCommandBuilder = New OdbcCommandBuilder(adapter)
-
-
connection.Open()
-
-
adapter.Fill(dataSet, tableName)
-
-
' Code to modify data in DataSet here
-
-
' Without the OdbcCommandBuilder this line would fail.
-
adapter.Update(dataSet, tableName)
-
End Using
-
-
Return dataSet
-
End Function
-Frinny