How to read the first itme from a array of data row

I have an array of data row image

so I need to read the first item of first column. Could anyone help me and I need to read first the name raj and the age 23 but separtely. Thank u

Array(0).Item(0).ToString

will give you the first item of the first datarow

You can then access each data row by amending the first value i.e. Array(1) etc…

Each column can be accessed by amending the second value .Item(1) etc…

1 Like

@kartik_sareen
I am assuming arr_dtrow is of variable type Datarow.

so arr_dtrow = image

you can read:
items from column “Name” as

arr_dtrow(0).Item(“Name”).ToString = Country
arr_dtrow(1).Item(“Name”).ToString = Raj
arr_dtrow(2).Item(“Name”).ToString = India

To read data from column “Age” just replace Name by Age in above statements.

You can refer the attached example - ArrayDataRow.zip (15.3 KB)

Please let me know if it helps.

Hi,
I tried the same and I’m getting an error message -" index was outside the bounds of the array" . What might be the problem?