How to only take certain count for datarow array

hi, this is my select datarow:
DtPhase2.Select("[Order No] =’"+OrderNoTest+"’ AND [Sample ID] is null")

This return 26 datarow. How to have datarow retrieve specific number. For example the datarow only return 3.

Hi @mashy2 ,

If you want to Retrieve only the First 3 rows after the Filter is applied then you could try the below :

DtPhase2.Select("[Order No] =’"+OrderNoTest+"’ AND [Sample ID] is null").Take(3)

If you required to Take the 3rd datarow only, then try the below :

DtPhase2.Select("[Order No] =’"+OrderNoTest+"’ AND [Sample ID] is null")(2)

Hi, got this error
image

@mashy2 , A Slight Modification .

DtPhase2.Select("[Order No] =’"+OrderNoTest+"’ AND [Sample ID] is null").Take(3).ToArray

We would need to Introduce .ToArray(), Please let us know if this is providing the result as expected.

tq so much!

1 Like

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