Sunday, 15 September 2013

Update requires a valid UpdateCommand need assistance

Update requires a valid UpdateCommand need assistance

Hi folks I am getting this error "Update requires a valid UpdateCommand
when passed DataRow collection with modified rows"
My code is
dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = " + AppDomain.CurrentDomain.BaseDirectory +
"Database1.mdb"
con.ConnectionString = dbProvider & dbSource
con.Open()
sql = "SELECT * FROM tbl_image"
da = New OleDb.OleDbDataAdapter(Sql, con)
da.Fill(ds, "database1")
'MsgBox("Database is now open")
con.Close()
MaxRows = ds.Tables("database1").Rows.Count
'here I just have a load of other stough
da.Update(ds, "database1")
MsgBox("Data updated")
con.Close()
If you need more info please let me know. Thanks

No comments:

Post a Comment