If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Help with OleDbDataAdapter Update

So I created a C# Windows Application using VS .NET 2005. I am connecting to a simple Access Database that has two columns. I placed a DataGridView on the form. I connect with the database successfully. Data rows are read correctly into the grid view via TableAdapter.Fill in form load. Then upon exit, I call TableAdapter.Update(DataSet.Table). That succeeds. In fact, Update returns the number of updated rows. I tested with modifying one row, it returns 1 or modifying four rows it returns 4. I even did a loop displaying contents of DataSet.Table and verified in the debug window that the content is the updated content. Problem is data does not get persisted to the database. I open Access Database or relaunch the application and old data is still there. I searched over the internet and people were saying you need to set update command. Framework already does that for me. I found the code where update command is set.

In form load: patientIdMapTableAdapter.Fill(patientIdMapDataSet.PatientIdMap);
Upon pressing persist button: patientIdMapTableAdapter.Update(patientIdMapDataSet.PatientIdMap);

The fill correctly populates the data as I see all the rows in grid view. I also verify that patientIdMapDataSet.PatientIdMap contains the updated data based on my modifications in grid view within persist button by displaying contents of each row. The call to Update passes and returns the number of updated rows. Unfortunately, the data in the database does not get updated.

Essentially, I created a two column Access database that would map an actual patient Id to an anonymous patient Id that we generate. This has to do with HIPAA rules and this database will reside on the client's machine. Above code was auto-generated.