Before LINQ I would have my main application return the results of a SQL query into a dataSet. I would then transfer the dataset as a parameter to the external dll. Now I am bringing through a LINQ to SQL query that is returned as an IQueryable(Of vClientTable) object. I want to be able to transfer that set of vClientTable results to my external dll in order for the dll to work with the data included in the results.
I am probably doing it all wrong as well as trying to do it all wrong, but would like some advice on what would be the best method to use.
DB Query
Public Shared Function getClientData(ByVal clientID As Int32) As IQueryable(Of vClientTable)
Try
Dim r = From p In dbLINQ.vClientTable _
Where p.ltClientID = clientID _
Order By p.cdCode _
Select p
Return r
Catch ex As Exception
Return Nothing
End Try
End Function
App Sub that retrieves the Data through the DB Query
Dim recordData As IQueryable(Of vClientTable) = getClientData(clientID)
Call to External DLL sub
dataComplete = outputClientData(Now, recordData)
DLL sub
public static Boolean outputClientData(DateTime rptDate, IQueryable<vClientData> clientData)
{
//Do something with the data
return true;
}
Obviously in the external dll it has no idea what an IQueryable(vClientData) object is and even if I create a dbml file and datacontext in my external project for the dll that includes the same class to the DB table/view it still says that the objects are different types.
Any ideas how I should be proceeding with this?
Thanks