Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i get DataRow index
Message
De
11/06/2011 12:33:39
 
 
À
11/06/2011 01:20:38
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01514108
Message ID:
01514126
Vues:
46
Alex,

>I try the below code error... Value of type '1-dimensional array of System.Data.DataRow' cannot be
>        a = WilsonDataSet.accessright.Rows.IndexOf(WilsonDataSet.accessright.Select("userid='111'"))   'error in this


The .Select() method returns an array of DataRows (obvious from the error message you're getting). You need to do something like this:
DataRow[] rows = WilsonDataSet.accessright.Select("userid='111'")
If (rows.Length > 0)
    a = WilsonDataSet.accessright.Rows.IndexOf(rows[0])
~~Bonnie





>Hi all,
> I add more more DataRow, i want to get the DataRow index. For example, i have 5 records, i want to record 2 index (Filter funcid and userid)
>I find AccessrightBindingSource.Find("funcid", "aaa") function , but this function only one parameter, if i want to check 2 parameter, not ok ...
>Although i can use ds.dt.Select("userid='111' and sysid='aaa'") to record 2 but can' t get this index...
>After i find ds.dt.Rows.IndexOf but how can i use , anyone one can give some idea , thank you ~~~
>
>I try the below code error... Value of type '1-dimensional array of System.Data.DataRow' cannot be converted to 'System.Data.DataRow'
>
>
>Dim a As Integer
>
>        
>        a = WilsonDataSet.accessright.Rows.IndexOf(WilsonDataSet.accessright.Select("userid='111'"))   'error in this
>
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform