Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to convert datatable to iqueryable format.

My code follows.

VB
Dim dttable As DataTable = LINQToDataTable(CurrentDataSource.PanbasedFolios(fund, pan, 0, "").AsQueryable())
Posted
Updated 4-Nov-14 1:52am
v2

Hi,

To convert a DataTable to IQueryable, I use this:
Dim query As IQueryable = dt.AsEnumerable().AsQueryable()
 
Share this answer
 
Comments
s v mangababu 5-Nov-14 0:26am    
Unable to cast object of type 'System.Linq.EnumerableQuery`1[System.Data.DataRow]' to type 'System.Linq.IQueryable`1[RMFMOBService.PanbasedFolios_Result]'. i got this error while using above line.
check this previews post
convert to datatable to iqueryable[^]
 
Share this answer
 
Comments
s v mangababu 5-Nov-14 0:37am    
Public Function getpostfolios(ByVal number As String, ByVal post As String) As IQueryable(Of postFolios_Result)
end function

Unable to cast object of type 'System.Linq.EnumerableQuery`1[System.Data.DataRow]' to type 'System.Linq.IQueryable`1[getdataService.postFolios_Result]'. i got this error while using above line



i am using ypur code line it shows error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900