Results 1 to 3 of 3

Thread: Serialize DataTable

  1. #1

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Serialize DataTable

    This just doesn't make sense to me at all. I know you can't return a DataTable from a web service method. I know the work around is to return a DataSet instead.

    The DataTable can't be serialized and that's by design, according to MSDN. But the DataSet can, and the DataSet contains DataTables (probably). A DataTable obviously gets serialized when you serialize a DataSet, so why can't you just deal with the DataTable?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Re: Serialize DataTable

    I haven't tried it, but the DataTable (according to MSDN Library) is serializable:

    <Serializable>
    Public Class DataTable
    Inherits MarshalByValueComponent
    Implements IListSource, ISupportInitialize, ISerializable

    If you are talking about the .WriteXml() method, then that is a whole different thing since it is an implementation thing.

  3. #3

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: Serialize DataTable

    Not sure about that, I guess I mean this. Like I said it's easy enough to work around, I just don't understand why it's like that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width