Get specific values out of simple datatable

I have a simple Datatable which has 1 line. How can I assign the let’s say Billing address to a var?

assign: Bill_addr = dt_header.enumerate.???

[Date,Name,Invoice No.,Billing Address,Vendor Address,Currency,Tax Amount,Total,Items
2019-04-07,Tiefland Glass AG,850888,“231 Lyoner Street Frankfurt,DE,60441”,“123 Basedow Street Leipzig,DE,04277”,EUR,950.00,5950.00,table

Sorry - curently lost my brain:-( Hope someone is awake the weekend:-)

if its only one row you can retrieve directly

yourdatatablevar.Rows(0)(“Billing Adress”).toString


Two ways to access the required field from the data table - using indices of column & row or using column name.

As you said, if your data table contains only one row then do the following -

Using Column Index: Column index starts from 0
strBillingAddress = dtHeader.Rows(0)(3).ToString

Using Column Name:
strBillingAddress = dtHeader.Rows(0)("Billing Address").ToString

Karthik Byggari

1 Like

Thanks a million for quick reply and help!

Thanks Karthik for showing me 2 solutions a million thanks for quick reply and help!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.