You cannot return a SqlDataReader from a Web Service. This
is a stream based object which cannot be serialized to
cross machines boundaries over SOAP. You can use the
DataSet instead.
[color=blue]
>-----Original Message-----
>Is it possible to return a SQLdatareader from a web
>service?
>.
>[/color]
Well what you can do instead of using dataset (as it is heavy) just have the
datareader stream packed in some object that could be crossed over using web
services. I usually convert all my complex types into a string
implementation and at the other end (Webservice client) I convert it back.
It works for most of my implementations , though I have never tried to do
this with a datareader but I guess you can do it. Give it a try and reply
back with the results.
Remember there is a slight disadvantage attached to this practice. As such
implantations can only work with custom clients. It sort of beats the
underlying principle of universal interpretably of the web services.
Another option could be using Remoting if the scenario allows it.
By the datasets are heavy but you would have to agree that they are best way
to send large amounts of data (specifically relational data), as it is has
many options built into it and is natively supported by the Webservices.
Also don't forget to read the doc mentioned below on MSDN:
"Dave O" <david.orridge@ btinternet.com> wrote in message
news:676901c343 4a$0711bdf0$a40 1280a@phx.gbl.. .
[color=blue]
> Is it possible to return a SQLdatareader from a web
> service?[/color]
Comment