Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When Adding a new row
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00924387
Message ID:
00925879
Vues:
19
Shawn,

>But when i check the dr object it has two rows .
>zero as the first row which is from the server filled with data, and 1 for the second row which is the new row i added.
>
>How do i find the new row, if the above syntax is not correct assumption.

If you're working with a DataTable (as opposed to a DataView) a new row is added to the end of the Rows collection, so you could retrieve the last added row as follows:
DataRow dr = ds.Tables[tableName].Rows[ds.Tables[tableName].Count-1];
However, even easier, when a new DataRow is added you can access the new row from the business object's DataRow property.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform