locked
Data Access problem...... RRS feed

  • Question

  • how to serialiaze datareader in webservice or how to return a datareader from webservice????????????
    • Moved by Esther FanMicrosoft employee Wednesday, October 6, 2010 10:49 PM (From:Visual Studio Class Designer)
    • Moved by Barclay Hill Monday, October 18, 2010 4:51 PM More appropriate forum (From:Visual Studio Database Development Tools (Formerly "Database Edition Forum"))
    Sunday, April 4, 2010 6:58 AM

All replies

  • you can't Because, it's not Serializable instead return Dataset or data in XML format

    <snip>

    "You can only return objects that are XmlSerializable from WebService methods. Keep in mind that webservices are NOT about transfering objects, they are about passing XML documents around.
    Instead of returning your datareader (which wouldn't work cross-process/cross-machine, anyway, regardless of the technology, since it is a connection-bound object), create and xml document with the data from the datareader and return that instead."

    </snip>

    Source: http://forums.asp.net/p/431497/431541.aspx#431541


    Manish Sati
    • Marked as answer by Martin_Xie Friday, April 9, 2010 6:22 AM
    • Unmarked as answer by i m unique Wednesday, April 14, 2010 7:03 PM
    Monday, April 5, 2010 5:48 AM
  • thnx....Bt Serialization does both things

    create objects for prograaming concern & for xml also.........

    I hav a bet tht Webservice kn return DATAREADER........

    Saturday, April 10, 2010 8:13 PM