Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to access data in a DataTable?
Message
De
19/05/2005 20:07:13
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
How to access data in a DataTable?
Versions des environnements
Environment:
C# 1.1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Divers
Thread ID:
01016070
Message ID:
01016070
Vues:
65
VS 2003:

I think this question is absurdly basic but I've spent half a day in an unsuccessful search for the answer.
// Suppose I've defined and filled a DataSet, ds, with a single DataTable Table1:
// I should be able to do something like
DataTable dt = ds.Tables["Table1"];

// Now that I have a reference to the table, how do I read values from its rows/columns?
// I'd expect to be able to do something like
SomeType someValue = dt.Rows[SomeRowNumber].Columns[SomeColumnName or Index].Value

// but Intellisense is showing nothing of the sort.
I could find no code samples on the Web. Literally all I could find in MSDN under "Viewing Data in a Table" was "You can access the contents of a DataTable using the Rows and Columns collections of the DataTable."
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform