How to extract data of particular row using Linq?

This is my excel data, i want to extract that “5454” value using “Total add on” row…
image

Using this query:

InputDT.AsEnumerable().Where(Function(x) x(0).ToString.ToUpper.TrimEnd.TrimStart.Contains("Total add on")).Select(Function(y) y)(0)(2).tostring.trimend.trimstart

But its giving me this error: Message Box: Object reference not set to an instance of an object.

1 Like

Hi,

Perhaps you should use uppercase like Contains(“TOTAL ADD ON”) becuase of ToUpper.

Regards,

2 Likes

Lol :laughing: thanks now its giving proper ouput

1 Like

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