Re: cloning IDbDataReader (SqlDataReader)

Kevin Hegg <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <00b801c68a92$4fb4dff0$6801a8c0@kevinheggxps>
> After reviewing the MSDN documentation, OUTPUT parameters
> cannot be retrieved until after closing a SqlDataReader
> object - but the SqlDataReader object doesn't support the
> ICloneable interface (though SqlCommand does).
> So it seems easy enough to fill a SqlDataReader object using
> cmd.ExecuteReader yet I can't access any stored procedure
> OUTPUT values until I close the reader.
>
> Peter
>

I think part of your problem is that you are thinking of the "reader"
objects as collection objects. They aren't. The are iterator objects. They
iterate through bits coming across the network. In the case of SQL Server it
is TDS bits. Cloning this type of iterator doesn't make sense since the
stream can only be iterated once in a forward-only mode.

Kevin Hegg

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.