Hi Cj,
once I've changed a few records in the datatable I want these changes to
be reflected in the datasource. How do I accomplish that?
Once you change a record in a DataTable, the changes are reflected in the
DataTable.
For example, we have a DataTable and retrieve data from a table in the
database and fill the data into the DataTable using SqlDataAdapter object.
All the rows in the DataTable have the RowState property of value Unchanged.
Then we make some changes to the first row in the DataTable and the changes
are there in the DataTable. But the value of the RowState property of the
first row becomes Modified.
You can call the GetChanges method on the DataTable to get a copy of the
DataTable containing all changes made to it and save the resulting
DataTable to the database. After you save the changes to the database
successfully, you can call the AcceptChanges method on the previous
DataTable to commit all the changes made to the table and then the value of
the RowState property of the first row becomes Unchanges again.
Hope I make some clarifications.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support