Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to access data in a DataTable?
Message
From
19/05/2005 20:07:13
 
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
How to access data in a DataTable?
Environment versions
Environment:
C# 1.1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01016070
Message ID:
01016070
Views:
64
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
Next
Reply
Map
View

Click here to load this message in the networking platform