Re: Question on SqlDataReader.Close by Miha
Miha
Mon May 02 15:28:06 CDT 2005
Hi,
AFAIK when you are returning records from stored procedure all records have
to be returned to get the output parameters values.
So, yes, Close will fetch all the remaining records and set parameter
values.
It doesn't make much difference since you will have to call Close anyway -
regardless if you want to read or not all records.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info
<AESi@community.nospam> wrote in message
news:e$lUXczTFHA.3188@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> According the MSDN documentation on the SqlDataReader.Close method, it
> says
> that:
>
> The Close method fills in the values for output parameters, return values
> and RecordsAffected, increasing the amount of time it takes to close a
> SqlDataReader....
>
> Is that mean before I can retrieve the value of stored procedure output
> parameters, I should call the SqlDataReader.Close method? But in some
> sample
> code I found on the web, it reads the output parameters before calling the
> Close method?
>
> Which is more appropriate?
>
> Thanks for help!
>
>
> Best Regards,
> Tony
>
>