Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp`s SEEK equivalent
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00760192
Message ID:
00760203
Vues:
10
There is no exact duplicate functionality. You can however use the Find method of a DataView to locate a record and return its index inside the table. The Find method uses the current sort index to locate the record. Then you can set the Position property of the CurrencyManager.
int nFound = 0;
nFound = oDataView.Find("StringToSearch");
The DataTable.Rows collection also has a Find method but you can only find the record based on a primary key that has been defined for the DataTable.

>hi,
>here's a sample table called "fruits" with primary key "code"
>
>code desc
>----- -------
>BAN BANANA
>APP APPLE
>TOM TOMATOE
>
>in visual foxpro, issuing:
>=seek("APP","fruits", "code")
>will move you to the second row of the table fruits.
>
>in vb.net having a dataset with the same structure..
>i have two textboxes (txtcodesearch) and one button (btnSearch)
>looks like this;
>----------------- -------------
>| txtcodesearch | | btnSearch |
>----------------- -------------
>
>-----------------
>| txtdesc |
>-----------------
>
>- my txtdesc is bound to dsfruits1.fruits.code
>- my txtcodesearch is not bounded, i use it to type the code i want to search
>- my btnSearch will search the code typed in the txtcodesearch in the dataset and
>
>"me.bindingcontext..." something to my txtdesc.
>
>how to i move my record to the second row by finding the APPLE record?
>
>-TIA
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform