How can we get the value in colum ‘n’ inside a datatable without using a for each loop? Let’s say i need to get the value ‘Rob’ in the table below.
What i have tried is using myDT.select(“Key=‘Name’”) and use For Each to the returned dataRow and use get row item activity to extract the value.
I have around 600 rows and i dont want to create 600 For each loops. Is there any other way of dealing this?
Thanks @Mr_JDavey for responding and for the sample solution, I appreciate the effort.
However, that is similar to what I was trying.
What I want to know is if it possible to get the value without using any “For Each” loop at all.
Like get the value of “Name”, (pseudo) myDT.select(“Key =‘Name’”)(row)(col).ToString.
Or can I directly access the value inside a DataRow without using a loop? Let’s day dRow(0)(1)?
I already found the answer.
It took me some trial and error, I’m not sure if this is an efficient way but it is working and most importantly it is a one liner.
Of course we can access inside a Datatable using indexes such as myDT.Rows(0).Item(1).ToString,
but when using a search criteria such as SELECT inside a DataTable, we can use