This question is locked. New answers and comments are not allowed.
Hello,
I need to build a dynamic LINQ query (VB.NET) where the sort field must be build as string at runtime. My query is like this:
Dim lobjQueryGenData As IQueryable(Of clsDmlEO) = From GenData In ObjectScope.Extent(Of clsDmlEO)() Select GenData Where GenData.SessionId = pstrSessionId
lobjQueryGenData = lobjQueryGenData.OrderBy(Function(GenData) GenData.RowId)
clsDmlEO is a "<Telerik.OpenAccess.Persistent()> <Serializable()>" class mapped to SQL Server table.
I need to change the OrderBy in something like this:
lobjQueryGenData = lobjQueryGenData.OrderBy(pstrSortField)
Please can you help me?