How to get a specific item from a Data table

studio

#1

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

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


#3

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


#4

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


#5

Thanks for the help @MAHESH1 and @arivu96 !