Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 07, 2008 09:40 PM by johngccfc
Jul 07, 2008 08:00 PM|LINK
I'm using VB.NET. I am creating extremely dynamic sql expressions being fed into a stored proc that is little more than an EXECUTE wrapper. I will feed in the table and column names as parameters. Then whatever is being returned (which would be a recordset
in old money), I'd like to cycle through it. Unfortunately I can't drag the tables onto my DBML and have them strongly typed.
What is the Type, or Object that I catch the records into that I can then cycle through (with a for each loop) ??
someWayOfCatchingTheReturnedRecords = myDataContext.myStoredProc(VeryVariableStringWhichNeedsExecuting)
Jul 07, 2008 08:57 PM|LINK
have a look at
this blog post by Scott Guthrie (in the "Handling multiple result shapes from SPROCs" section).
Jul 07, 2008 09:40 PM|LINK
Thanks for the reply. Excuse my possibly dim response. I'm pretty new to Linq.
Doesn't this rely on the fact that Products or Orders are going to be returned and they already 'belong'.
I'm hoping to find something that would accomodate the fact that some quantity of some type of records were returned, and we won't know what they are.
However, as they are a bunch of returned records, they could be cycled through as they are records and records can be cycled through.
i.e. in that example, could I use;
For Each result in IMultipleResults
' do my stuff
And leave the fact that they may be products or orders or widgets completely undermined?