Hi there, my robot writes datarows to a datatable. Now, I would like to add a condition, that it only adds the row if it doesn’t exist already in the table. How can I do this?
Let us take you are having a datatable dta and data row as dr
In if Condition
(From p In dta.Select Where string.Join(",".p.ItemArray).Equals(string.Join(",",dr.ItemArray)) Select p).Count>0
If the count is greater than zero then the row already exists in the Datatable else the datarow is not present in the datatable.
@MAHESH1 Thank you for the quick help. Is p the row? Should I put the p in a for each row activity?
No need, you just replace the entire query in If condition, just rename the datatable variable and datarow variable.
It says that p is no member of string.
What am I doing wrong?