Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get a value from a select in a dataset
Message
 
À
28/11/2005 07:07:48
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01072368
Message ID:
01072677
Vues:
16
This message has been marked as the solution to the initial question of the thread.
Kurt,

>for the moment i'm starting to work with webmatrix. Like i don't now nothing about asp.net and vb.net i have a lot of questions. One of these questions is :
>
>I have a dataset that i filled via a select. This dataset should return one value, so i made the following syntax :
>if myDataset.table(0).count <> 1
> mylabel.text='Error loading information'
>else
> dim cCurrentuser as newdataset....
> .....
>endif
>
>In the else clause i want to get the value of that one field in the table. Does somebody knows how to get it ?

Assuming this is an untyped DataSet (it is by default) the code you use depends on the data type of the data in the column. Untyped data columns are of type Object so you must cast it to the correct type. For example, if you column holds an integer, you can do something like this
Dim i As Integer = CInt(myDataSet.Table(0).Rows(0)(0))
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