Sql Pass through fails
Posted: Tue 22 Nov 2011 18:53
Hi I have a simple pass through query that I am trying to use and it's giving me fits.
Dim qry As IEnumerable(Of V_REPORTING) = db.ExecuteQuery(Of V_REPORTING)(select f1, f2, f3 from V_Reporting)
I've dropped V_Reporting onto my lqml. It has a 5 fields.
For purposes of this discussion we'll just call them f1-f5.
If I query the db as shown above, I get an error that it can't find f4 and f5.
If I query all the fields it works fine.
This works correctly when I use regular LinqToSql with SqlServer.
Is there some magic sauce I am missing?
Because the field list is built at run time, I don't know ahead of time what the result set will look like.
Any help would be greatly appreciated!
Thanks ... Ed
Dim qry As IEnumerable(Of V_REPORTING) = db.ExecuteQuery(Of V_REPORTING)(select f1, f2, f3 from V_Reporting)
I've dropped V_Reporting onto my lqml. It has a 5 fields.
For purposes of this discussion we'll just call them f1-f5.
If I query the db as shown above, I get an error that it can't find f4 and f5.
If I query all the fields it works fine.
This works correctly when I use regular LinqToSql with SqlServer.
Is there some magic sauce I am missing?
Because the field list is built at run time, I don't know ahead of time what the result set will look like.
Any help would be greatly appreciated!
Thanks ... Ed