Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to go to my desired desired data row?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01169045
Message ID:
01170111
Vues:
13
Jess,

>I haven't asked them yet but at the moment, I decided to make do with the SelectedRowCollections and Selected.Rows of the grid. The only problem that I am about to solve now is: what if a dataset is not bound to a grid control? How can I go through all the data rows of a datatable? I am trying to to look something that is similar to the Scan...EndScan of VFP.

You can cycle through the rows in a DataTable like this:
foreach (DataRow Row in dt.Rows)
{

}
You can search for a specific DataRow in a DataTable in one of two ways:

1. If you have the primary key, use the Find() method of the data table. For example:
DataRow Row = dt.Rows.Find(pkValue);
2. If you don't have the primary key, use the Select method of the DataTable. For example:
DataRow[] Rows  = dt.Select("FirstName = 'Jess'");
Best 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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform