Dataset: How to Access specific column data?

D

David M

When using a dataset, how can one get to a column data element using this
format:

dataset.Tables[0].Rows[0]....

I can get to a specific row, but I am not sure how to get to the column or
data. I tried using the keyword Column, but no luck.

Also, is direct access the best way to access this data, or should I be
using different DataRows, etc. Keywords

Thanks
 
R

Ron Allen

David,
Use .Columns[xx] where xx is either a number or a string with the field
name. You can also use a name for the Table index.
Ron Allen
 
R

Ron Allen

Oops,
Ignore the Columns in the previous and use just [xx] where xx is either
a string or integer key. I've been working with a custom control with a
Columns collection for about the last 2 days and my mind was 'stuck' on
columns.
Ron Allen
Ron Allen said:
David,
Use .Columns[xx] where xx is either a number or a string with the field
name. You can also use a name for the Table index.
Ron Allen
David M said:
When using a dataset, how can one get to a column data element using this
format:

dataset.Tables[0].Rows[0]....

I can get to a specific row, but I am not sure how to get to the column or
data. I tried using the keyword Column, but no luck.

Also, is direct access the best way to access this data, or should I be
using different DataRows, etc. Keywords

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top