VB.NET Dataset doesn't seem to update actual data source

I have the following code:

objDataSet.Tables("Table").Rows(Row).Item("TimeAccumulator") = objDataSet.Tables("Table").Rows(Row).Item("TimeAccumulator") + PingRate
Dim oCB As OleDbCommandBuilder = New OleDbCommandBuilder(objAdapter)

which runs without any errors, but the data source (i have tried both MS Access 2002 and SQL 2000) does not get updated.

I know that the dataset has my changes in it because I have called the objDataSet.GetXML method and written the XML to the event log and I can see my changes.

What am I missing?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Where does dsModified come from?  You seem to have updated the objDataSet object - not dsModified.  objDataSet.GetXML shows your changes, but do you see them in dsModified.GetXML since that is what you are passing to the update call?

bradmqAuthor Commented:

I posted code between edits.  The line should actually read


I had had some code previously that looked like this:

Dim dsModified As New DataSet()
dsModified = objDataSet.GetChanges

then I was calling


This didn't work either so I had simplified it to just passing the dataset to the Update method.


Those are supposed to be parens and not brackets...
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Ignore that post please...wrong window.
bradmqAuthor Commented:
I figured out the problem:

The Update method on the adapter has to be called before the Acceptchanges method on the dataset!

Seems stupid and counter intuitive but I guess if I needed to rollback, I could call dataset.rejectchanges and call the adapter.update method again.
PAQed, with points refunded (125)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.