Do not understand error message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get this error message when I try to update mydataadapter. "Update requires
valid update command when passed Datarow collection w/modified rows".

Dim radiobutton as string, I as integer,Counter as integer=0,
PicksCounter as integer=0
Dim UserName as string=session("User")
Dim myConn as New
OleDb.OleDbConnection("Provider=Microsoft.Jet.oledb.4.0; Data
source=d:\webpages\footballpool\football.mdb")
Dim myCmd as string="Select * from Week1 where Name='" & username &
"'"
Dim myDataAdapter2 as New OleDbDataAdapter(myCmd,myConn)
Dim myDataSet as New DataSet()
Dim Rows as Datarow
Dim Col as integer=0
myDataAdapter2.Fill(myDataSet,"Picks")

** code to change values in mydataset. Only one row was loaded by the fill
command **

** This causes the error **
myDataAdapter2.update(myDataSet,"Picks")

All the code I have found on the internet uses just the update command like
I have above. The code works up to the update command. My new values are put
into mydataset. I just can't get them back to the database. Does it have
anything to do with the fact that I only have one row in my dataset and not
the whole table??
 
You don't have any definitions for the update command. Whatever code you
found, must define what the update command is, otherwise the adapter does
not know how to update your row.
 
Back
Top