Returning multiple datasets from a stored proc in VB
Posted
by Ryan Stephens
on Stack Overflow
See other posts from Stack Overflow
or by Ryan Stephens
Published on 2010-01-19T14:26:03Z
Indexed on
2010/05/09
20:28 UTC
Read the original article
Hit count: 208
I have an encrypted SQL Server stored proc that I run with (or the vb .net equivalent code of):
declare @p4 nvarchar(100)
set @p4=NULL
declare @p5 bigint
set @p5=NULL
exec AA_PAY_BACS_EXPORT_RETRIEVE_S
@PS_UserId=N'ADMN',
@PS_Department=N'',
@PS_PayFrequency=2,
@PS_ErrorDescription=@p4 output
select @p4, @p5
this returns 2 datasets and the output parameters for the results, the datasets are made up of various table joins etc, one holds the header record and one the detail records.
I need to get the 2 datasets into a structure in VB .net (e.g. linq, sqldatareader, typed datasets) so that I can code with them, I don't know what tables any of this comes from and there are alot of them Whooopeee!!!
I came close using Linq to SQL and IMultipleResults but got frustrated when I had to recode it every time I made a change to the designer file.
My feelings are that there must be a simple way to do this, any ideas?
© Stack Overflow or respective owner