How to get a specific item from a Data table

Hi,

I what the syntax is for getting a specific item from a Data Table, DT.
Example: I want to get the item in the third row in column number 4.

I know how I can solve it by using Get row item and For each loop, but i want to use an assign function.

I have tried
DT.Rows(1).Table.Columns(3).ToString
…but it just works on the first row. When i change the row index it still outputs the same.

Any help would be appreciated :slight_smile:

2 Likes

I think I found the solution by using:
DT.Rows(3).Item(4).ToString

HI @skandi,

Dt.Rows(RowNumber)("ColumnName").ToString()
or
Dt.Rows(RowNumber)(ColumnIndes).ToString()
Example
Convert,ToString(Dt.Rows(0)("Name"))
or
Convert,ToString(Dt.Rows(0)(1))

Regards,
Arivu

5 Likes

@skandi
DT.Rows(3)(4).ToString
Regards,
Mahesh

5 Likes

Thanks for the help @MAHESH1 and @arivu96 !