A
Andrew Cooper
Greetings,
I'm running into a little problem with a Dataadapter object. I'm using it
to fill a Datatable but when I later try to Update the database using the
Dataadapter.Update method, I get an error saying that the INSERT INTO
statement is not correct. When I look at the CommandText of the Insert
command, I get that it isn't set to anything even though I used a
Commandbuilder to populate it. Any help would be appreciated. Here's my
code...
<code>
....
Private oPlayersDA As New OleDbDataAdapter()
Private oCmdBldr As OleDbCommandBuilder
Private oDataSet As New DataSet()
.... some code here ...
oPlayersDA.SelectCommand = New OleDbCommand()
With oPlayersDA.SelectCommand
.CommandType = CommandType.Text
.CommandText = "SELECT * FROM Players"
.Connection = oConn
.CommandTimeout = 30
End With
oCmdBldr = New OleDbCommandBuilder(oPlayersDA)
oPlayersDA.Fill(oDataSet, "Players")
.... some code here ...
oPlayersDA.Update(oDataSet, "Players")
</code>
I'm at a loss...
Andrew
I'm running into a little problem with a Dataadapter object. I'm using it
to fill a Datatable but when I later try to Update the database using the
Dataadapter.Update method, I get an error saying that the INSERT INTO
statement is not correct. When I look at the CommandText of the Insert
command, I get that it isn't set to anything even though I used a
Commandbuilder to populate it. Any help would be appreciated. Here's my
code...
<code>
....
Private oPlayersDA As New OleDbDataAdapter()
Private oCmdBldr As OleDbCommandBuilder
Private oDataSet As New DataSet()
.... some code here ...
oPlayersDA.SelectCommand = New OleDbCommand()
With oPlayersDA.SelectCommand
.CommandType = CommandType.Text
.CommandText = "SELECT * FROM Players"
.Connection = oConn
.CommandTimeout = 30
End With
oCmdBldr = New OleDbCommandBuilder(oPlayersDA)
oPlayersDA.Fill(oDataSet, "Players")
.... some code here ...
oPlayersDA.Update(oDataSet, "Players")
</code>
I'm at a loss...
Andrew