troubleshooting Question

get scalar value from linq query

Avatar of talker2004
talker2004Flag for United States of America asked on
.NET ProgrammingC#
2 Comments1 Solution4295 ViewsLast Modified:
I have the following linq query, all i am interested in is the Employee name. I want to return the scalar value of EmpName and return it to a variable strEmployeeName. dsEmp is an dataset which caches the entire Employee table before the method is called.

dim StrEmployeeName as String

dim IEmp as IEnumerable(Of DataRow)
IEmp = _
    From e In dsEmp.Tables(0).AsEnumerable() _
    Where e.Field(Of String)("EmpID") = 123 _
    Select e

strEmployeeName = ?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros