Dim intEmpCritGID As Int32 = DirectCast(e.Row.DataItem, DataRowView).Row.ItemArray(0)
Dim result1 = (From c In Criteria.EmployeeCriteriaInfo
Where c.Field(Of Integer)("EmpCritGID").Equals(intEmpCritGID)
Select c.Field(Of Boolean)("CritOrgFlag"))
I have been playing around with method syntax and how I was writing it was too long. I knew I was doing something wrong so I went back to this syntax.
Dim result1 =(Criteria.EmployeeCriteriaInfo .Where( c => c.Field(OfInteger)("EmpCritGID").Equals(intEmpCritGID) ) .Select( c => c.Field(OfBoolean)("CritOrgFlag")))
WebAppArchit...
Member
7 Points
39 Posts
This linq to datatable works, however, is there a 'better' way?
Jul 10, 2012 06:43 PM|LINK
Dim intEmpCritGID As Int32 = DirectCast(e.Row.DataItem, DataRowView).Row.ItemArray(0) Dim result1 = (From c In Criteria.EmployeeCriteriaInfo Where c.Field(Of Integer)("EmpCritGID").Equals(intEmpCritGID) Select c.Field(Of Boolean)("CritOrgFlag"))I have been playing around with method syntax and how I was writing it was too long. I knew I was doing something wrong so I went back to this syntax.
itsbpk
Member
475 Points
144 Posts
Re: This linq to datatable works, however, is there a 'better' way?
Jul 10, 2012 08:56 PM|LINK
mayankpathak...
Contributor
3643 Points
850 Posts
Re: This linq to datatable works, however, is there a 'better' way?
Jul 11, 2012 06:04 AM|LINK
better approach is your second post using lambda....
WebAppArchit...
Member
7 Points
39 Posts
Re: This linq to datatable works, however, is there a 'better' way?
Jul 11, 2012 03:30 PM|LINK
Thanks for the feebback everbody!