Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataRow.BeginEdit, EndEdit, and AcceptChanges methods
Message
De
31/01/2005 22:26:07
 
 
À
31/01/2005 21:13:45
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 1.1
Database:
MS SQL Server
Divers
Thread ID:
00982570
Message ID:
00982577
Vues:
29
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.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform