David,
And what are you doing with the rows that have not been checked?
~~Bonnie
>I want to retrieve data from a database, compare it data in a text file, update the data table to match the text file, and keep track of which records in the database were not checked because they weren't listed in the text file.
>
>I added a column to my datatable called "IsChecked" that holds a boolean value initialized to false. As I examine each row, I set IsChecked = true. Unchecked rows are VERY rare.
>
>Only a small number of rows actually differ from the data in my text file and I only want to send update statements to the database for rows which really require updates.
>
>My problem is that setting IsChecked = true sets the RowState value for the row to Modified even if though the other columns don't get changed, so that when I save, an update statement for every row is sent back to the DB.
>
>I couldn't find a way to use BeginEdit, EndEdit, and AcceptChanges to make it work. Deleting the IsChecked column didn't help, either.
>
>Am I just misusing my DataTable by using it to store information that doesn't exist in my database? Should I track which rows have been read in a separate data structure?
>
>If anyone can recommend an online resource that will help me understand how to use this IsChecked column without DataRows thinking that they have really been changed, I would appreciate it.