How to fetch specific column value from data table using query?

Hi Team,

Good Evening!!!

I wan to get EmployeeID value by passing pan number from data table.

please provide me the query for the same.

in sql like this

SELECT "COLUMN-EmployeeID " FROM ‘EMP_TABLE’ WHERE “COLUMN-PAN = VARIABLE PASSED”

Hi @Sanket_Shinde1

You can use the LINQ Expression,

- Assign -> EmployeeID = DT.asenumerable.where(Function(X) X("EmployeeID Column name").toString.Trim.equals(Pass variable here)).Select(Function(Y) Y("PAN Column name).toString).First.toString

Hope it helps!!

Getting this error for EmpID var

Assign: Unable to cast object of type ‘System.Double’ to type ‘System.String’.

Change the empid variable to system.string datatype… @Sanket_Shinde1

Hope you understand!!

Thank you so much @mkankatala

1 Like

It’s my pleasure… @Sanket_Shinde1

Happy Automation!!

1 Like

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