How to add a value into a DataTable (from Excel) link to a data inside the datatable

Hello,

I need help.
I have extract a datatable from an excel File.
I have to control if some datas inside the datatable are ok.
If it is ok, I need to add on the last column of this datatable the good price (store into a double variable).
I have already add the last column (with double type), but I need to match the good price with the Id of the article.

I hope I am clear.
I cannot write the double variable into the line where is the id article

my datatable is as following
Article | PMP| xxx| xxx| Good Price

So when I do my process to check if the article is OK, at the end, I have to write on the datatable the price (on the “Good Price” column). So I have to make a link betweek the article and the Price, so the price will be wrote at the right row.

thank you

May I know are you getting the Good Price, is it from another Excel or from a API call?

Hi,

Assign datarow variable as follow,
DtRow datatype is System.Data.Datarow
Dttable is the datatable read from your excel
DtRow = DtTable.select(“article = ‘OK’”)(0)

It will take the first row with article is ok
And again in assign

DtRow(“Good Price”) = xxx (double)