Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a cell of dataset

Tags:

c#

dataset

I am working with a windows application.

I load a dataset with dataadapter with fill
method.(objDataAdaptere.fill(objDataSet,"string"))

Now I want to get a cell of this dataset.(for example (row(0),cell(0))) How do I can do this? Thanks.

like image 571
Tavousi Avatar asked Dec 02 '10 07:12

Tavousi


2 Answers

The value? Assuming you mean "of the first table of the data-set", then:

    object value = dataSet.Tables[0].Rows[0][0];

but more specifically:

    object value = dataSet.Tables[tableIndex].Rows[rowIndex][colIndex];
like image 182
Marc Gravell Avatar answered Nov 07 '22 06:11

Marc Gravell


ds.Tables(0).Rows(0).ItemArray(0)

Where ItemArray Contains values like cell in gridView

like image 35
Jayant Bramhankar Avatar answered Nov 07 '22 05:11

Jayant Bramhankar