Need help using DataSet to update an MSAccess database.
Posted on 2007-12-05
Okay, this is driving me insane. I've spent two days on it, and need a very clear, very concise answer. It will need to have a working code example, not a link to yet another of the 1000 websites I've been routed to through google that I've gotten NOWHERE with. I will not even bother responding to "answers" that say "here, look at this link." I've spent 48 hours looking at links, now I want an answer...
That being said, I'm a VB6er of many years, making the switch to .NET, and can't fathom who in their right mind would've developed such a convoluted system for data access. I currently have an application that does the following:
oleCON = CON 'CON is a connection with the connection string passed to the class.
oleCOM = New OleDb.OleDbCommand 'New command.
oleDA = New OleDb.OleDbDataAdapter 'New Data Adapter.
oleDataSet = New Data.DataSet 'New Dataset.
oleCOM.Connection = oleCON 'Link the command object to the data adapter.
Then I populate the dataset like so:
oleCOM.CommandText = SQL
oleDA.SelectCommand = oleCOM
Up to this point, everything's fine. I'm able to modify the items in the dataset, and everything works until I try to then write that dataset BACK to the database:
I started with:
That threw an error, and what I tried next threw an error, and this has continued for 2 days. I NEED A SOLUTION.