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. ASP.NET
  4. DataSet vs. DataTable

DataSet vs. DataTable

Scheduled Pinned Locked Moved ASP.NET
questiondatabasevisual-studioxml
5 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.
  • S Offline
    S Offline
    slvrscremr
    wrote on last edited by
    #1

    Here's the query... I have an object that implements ICollection and want to expose it via a webservice. From everything I've read, the easiest approach is to dump the relevant data into an XML friendly object (i.e. DataSet, DataTable) and return (voila!). The question being more about style than substance, since I am not ever going to be returning more than a single datatable from a collection object, should I simply transform the data into a DataTable than a DataSet? The main benefits I've experienced from using DataSets come from managing multiple DataTables and their relating data... neither of which apply here. Am I on target or missing something? :cool: Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

    T M 2 Replies Last reply
    0
    • S slvrscremr

      Here's the query... I have an object that implements ICollection and want to expose it via a webservice. From everything I've read, the easiest approach is to dump the relevant data into an XML friendly object (i.e. DataSet, DataTable) and return (voila!). The question being more about style than substance, since I am not ever going to be returning more than a single datatable from a collection object, should I simply transform the data into a DataTable than a DataSet? The main benefits I've experienced from using DataSets come from managing multiple DataTables and their relating data... neither of which apply here. Am I on target or missing something? :cool: Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

      T Offline
      T Offline
      Tad McClellan
      wrote on last edited by
      #2

      I don't think datatables are serializable (for reasons only known to microsoft developers) so use a dataset. I think this is also fixed in vs 2005.

      S 1 Reply Last reply
      0
      • S slvrscremr

        Here's the query... I have an object that implements ICollection and want to expose it via a webservice. From everything I've read, the easiest approach is to dump the relevant data into an XML friendly object (i.e. DataSet, DataTable) and return (voila!). The question being more about style than substance, since I am not ever going to be returning more than a single datatable from a collection object, should I simply transform the data into a DataTable than a DataSet? The main benefits I've experienced from using DataSets come from managing multiple DataTables and their relating data... neither of which apply here. Am I on target or missing something? :cool: Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

        M Offline
        M Offline
        minhpc_bk
        wrote on last edited by
        #3

        Hi there, Just second the previous post, you will have this problem when you use a datatable as the return value of a web service: Problems using an XML Web service that returns a DataTable[^]

        S 1 Reply Last reply
        0
        • T Tad McClellan

          I don't think datatables are serializable (for reasons only known to microsoft developers) so use a dataset. I think this is also fixed in vs 2005.

          S Offline
          S Offline
          slvrscremr
          wrote on last edited by
          #4

          Thanks. I would have never guessed in a million years. Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

          1 Reply Last reply
          0
          • M minhpc_bk

            Hi there, Just second the previous post, you will have this problem when you use a datatable as the return value of a web service: Problems using an XML Web service that returns a DataTable[^]

            S Offline
            S Offline
            slvrscremr
            wrote on last edited by
            #5

            Thanks for the reference. Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

            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