LINQ to SQL question - using Stored Procedures with multiple resultsets

K

Kevin S. Goff

Suppose I have a stored procedure called GetAgingData - and the stored
procedure returns 4 result sets.

I want to use IMultipleResults to do the following:



MultipleResults result = db.GetAgingData(ParametersForStoredProc);

IEnumerable <GetAgingDataResult1> oHeader =
result.GetResult<GetAgingDataResult1>();


IEnumerable <GetAgingDataResult2> oDetails =
result.GetResult<GetAgingDataResult2>();


That all "works"....but I'd like to define the result names as something
more meaningful than "GetAgingDataResult1", "GetAgingDataResult2", etc.

Is there any way to change the result set names? I'm using SQLMetal to
generate the context file, but I'm not sure that creating a Linq to SQL
class will do any different.

As I'm typing, I wondered about subclassing the result names that are in
the context file....I'll try that out, but was curious if anyone else
has run into this.

thanks,
Kevin
 
M

Marc Gravell

but I'm not sure that creating a Linq to SQL class will do any different.

If you work with the "dbml" form, you can generally edit the xml
(either by hand or by the designer) to do anything you want. I haven't
tested this scenario, but I'd be very surprised if it wasn't trivial.
I'd try the designer approach first, with hand-editing the xml a
fallback.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top