How to Extract data from System.Data.DataRow type variable

Hello guys,

i am stuck in one issue, need to know the process for how to extract a row of data from a Master data table and after assigning that row to data row data table type of variable how can i access particular column in that data row.

Thanks in advance
-Asha

@asha_TN

DataTable is nothing but array of DataRows.

    dataRow = DataTable (index) 

You can read particular column value from DataRow like below.

           dataRow("ColumnName").Tostring

@asha_TN - Please check follow activity:

1 . Use For Each Row activity and provide Datatable variable as input.
2. You can access the row value row(“ColumnName”).ToString inside For Each row

Cheers

You can also use row(0).ToString
Here “0” is your first column and 1, 2, 3 so on.
It’s useful when your column name changes frequently. And you don’t have to change the column name in the Process.

Thank yo all for your help.

i understand the concept better now:)

-Regards,
Asha

@lakshman what if the column does not have a column name, but just data?

Hi @Yomi_Oluwadara

The columns will always have a name, even if this is not defined. The default is “Column1”, “Column2” etc. You can also always use the index of the columns if you do not know the names of the columns.

1 Like

@katharine.hardy Thanks

Hi

→ Use For Each Row datatable activity and use Datatable variable as input.
→ for getting the row value use row(“ColumnName”).ToString inside For Each row or you can use column index value aswell

Thank You