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
  1. Home
  2. Web Development
  3. ASP.NET
  4. can i return sqlDatareader from a webservice

can i return sqlDatareader from a webservice

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 3 Posters 0 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.
  • R Offline
    R Offline
    robmays
    wrote on last edited by
    #1

    to pass data to my client must i use the dataset only is the sqlDatareader a valid return type from a web service??

    M 1 Reply Last reply
    0
    • R robmays

      to pass data to my client must i use the dataset only is the sqlDatareader a valid return type from a web service??

      M Offline
      M Offline
      Mariusz Wojcik
      wrote on last edited by
      #2

      I don't think the SqlDataReader class is a good one to pass as a return type. This class is used to read data from the DBase, and it's strongly connected with the Database connection. I'm not sure it'll work (you'll be able to read data from dbase) if you send the object as a result. Definetely it's not the right way. -- Mariusz 'mAv' Wójcik master e-software engineer (BPC)

      F 1 Reply Last reply
      0
      • M Mariusz Wojcik

        I don't think the SqlDataReader class is a good one to pass as a return type. This class is used to read data from the DBase, and it's strongly connected with the Database connection. I'm not sure it'll work (you'll be able to read data from dbase) if you send the object as a result. Definetely it's not the right way. -- Mariusz 'mAv' Wójcik master e-software engineer (BPC)

        F Offline
        F Offline
        FruitBatInShades
        wrote on last edited by
        #3

        you can return a datatable or populated dataset but not a datareader as it requires an active connection to the database. Just populate a datatable with the info and return that. Definitely a PEBCAK! (Problem Exists Between Keyboard And Chair)
        My First ASP.Net site is now up :) RedRavenRPG

        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