How to access row Item from specific column?

If currentRow represents a row from a DataTable with two column in this order: Name and Age, what expression can be used to obtain the value from the column Age?

2 Likes

currentRow.item(0).toString and currentRow.item(1).toString

2 Likes

Hello @lordsupremo

You can use this

age = dt.Rows(0)(“age”).ToString

2 Likes

Is this the training exam question :thinking:

Hi @lordsupremo,

you can use 2 ways.

currentRow .Item(1).ToString()
or
currentRow .Item(“Age”).ToString()

Regards
Balamurugan.S

3 Likes

currentRow(“Age”)

What’s the difference between currentRow.Item(“Age”).ToString() and currentRow (“Age”).ToString()?

2 Likes