Tavousi
Tavousi

Reputation: 15486

Get a cell of 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.

Upvotes: 10

Views: 31680

Answers (2)

Marc Gravell
Marc Gravell

Reputation: 1063704

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];

Upvotes: 20

Jayant Bramhankar
Jayant Bramhankar

Reputation: 378

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

Where ItemArray Contains values like cell in gridView

Upvotes: 1

Related Questions