DataReader in a web service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave O

    #1

    DataReader in a web service

    Is it possible to return a SQLdatareader from a web
    service?
  • krammai

    #2
    DataReader in a web service

    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]

    Comment

    • Microsoft

      #3
      Re: DataReader in a web service

      Hello and Greetings,

      Dear David:


      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:



      - Consuming a DataSet from an XML Web Service



      J, Happy Coding


      Take Care,

      Rai Umair - .NET Question? .NET Answer! http://www.raiumair.com


      "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

      Working...