Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Data Reader Serialisation in web service

Data Reader Serialisation in web service

Scheduled Pinned Locked Moved Web Development
question
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shalender
    wrote on last edited by
    #1

    Hello All, Could any of you please tell me how can i return datareader from web service . How can i serialize datareader ??????????? Regards, Gandhi

    J 1 Reply Last reply
    0
    • S shalender

      Hello All, Could any of you please tell me how can i return datareader from web service . How can i serialize datareader ??????????? Regards, Gandhi

      J Offline
      J Offline
      Jeffry van de Vuurst
      wrote on last edited by
      #2

      You cannot serialize a datareader as far as I know. It doesn't implement the ISerializable interface. However, it does inherit from MarshalByRefObject so you could return a reference to the datareader from your webservice. So you could do something like this: SqlDataReader dr = myWebService.GetDatareader(); Just be sure to close the connection when you're done with the datareader! Depending on your needs, you might be better of with a DataSet, e.g. if you need to hold on to the data for a while. HTH, Jeffry

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups