0

Iam using data set and create table adapter then create select some data to be used in my aplication. In my app, i create data table to gain data from table adapter, but i don't know how to get some specific data, ex : item in column "a". Could you resolve it? Thanks :)

2
Contributors
2
Replies
16
Views
5 Years
Discussion Span
Last Post by nore
0

So you have used a dataAdapter to fill a dataTable. The items in the dataTable can be accessed using notation like this:

string sample = dt.Rows[0][1].ToString();

This is accessing the second element in the first row of the dataTable and storing it in a string variable. You can use column names rather than indexes if you prefer.

0

thanks! but the syntax should be like :

Dim sample as String = dt.Rows(0)(1).ToString()

:)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.