Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HookPreSaveEntity code not executing
Message
De
21/01/2009 15:42:17
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
19/01/2009 15:07:18
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01374504
Message ID:
01376038
Vues:
17
>Good afternoon,
>I found that I also needed to copy the changes back into the original dt datatable. Here's the code.
> protected override bool HookPreSave(DataTable dt)
> {
> System.Data.DataTable dtchanged = dt.GetChanges();
> foreach (DataRow dr in dtchanged.Rows)
> {
> dr["EdtDTime"] = DateTime.Now;
> }
> dt.Merge(dtchanged);
> return true;
> }
>
>rick

Yup, you made a copy of data inside your method so the original data wasn't changed. Glad you figured it out.
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform