Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know which columns changed
Message
De
14/05/2010 15:30:57
 
 
À
14/05/2010 14:41:59
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01464500
Message ID:
01464599
Vues:
45
You're welcome ... glad to help. =0)

~~Bonnie


>Thanks Bonnie,
>
>That got me what I needed.
>Tim
>
>>Hi Tim,
>>
>>Here's how you check for changed columns, for each row:
>>
>>
>>for (int i=0; i < MyTable.Columns.Count; i++) 
>>{ 
>>	if (!row[i, DataRowVersion.Current].Equals(row[i, DataRowVersion.Original])) 
>>	{ 
>>		// it's changed, process it here 
>>	} 
>>} 
>>
>>
>>~~Bonnie
>>
>>
>>>If I want to log all the changes that are made to a row in the dataset before it is saved, is there a way to know which columns changed within the changed rows?
>>>
>>>If I start with a DataTable that is to be saved, I can get the rows that have changes with GetChanges() but then looping through those, is there a way to tell which columns were changed?
>>>
>>>Alternatively, is there a way to take a snapshot of a DataSet easily for comparison later?
>>>Thanks
>>>Tim
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform