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. General Programming
  3. C#
  4. SerializationException With DataTable

SerializationException With DataTable

Scheduled Pinned Locked Moved C#
csharpquestion
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.
  • W Offline
    W Offline
    Wender Oliveira
    wrote on last edited by
    #1

    Hello, I'm trying to access a DataTable from a Typed Dataset through Remoting but when I call my method it throws the follow exception: [SerializationException] The constructor to deserialize an object of type TBPerfilDataTable was not found. But, when I try to return the full filled typed dataset it works... It only doesn't works with DataTables. Any idea? Wender Oliveira .NET Programmer

    S M 2 Replies Last reply
    0
    • W Wender Oliveira

      Hello, I'm trying to access a DataTable from a Typed Dataset through Remoting but when I call my method it throws the follow exception: [SerializationException] The constructor to deserialize an object of type TBPerfilDataTable was not found. But, when I try to return the full filled typed dataset it works... It only doesn't works with DataTables. Any idea? Wender Oliveira .NET Programmer

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi Wender, I'm not really sure if the TBPerfilDataTable class needs to have a default constructor (without any parameters). If I access an object using serialization (e.g. by using a WebSerice), the serialized class always needs a constructor without parameters. Is your datatable marked as serializable ? Regards Sebastian Trying to be a .NET Programmer ;-)

      W 1 Reply Last reply
      0
      • W Wender Oliveira

        Hello, I'm trying to access a DataTable from a Typed Dataset through Remoting but when I call my method it throws the follow exception: [SerializationException] The constructor to deserialize an object of type TBPerfilDataTable was not found. But, when I try to return the full filled typed dataset it works... It only doesn't works with DataTables. Any idea? Wender Oliveira .NET Programmer

        M Offline
        M Offline
        miah alom
        wrote on last edited by
        #3

        If you are deriving from the DataTable class, then you must add the following code protected MyDataTable(Serializati­onInfo info, StreamingContext context):base(info, context) { }

        W 1 Reply Last reply
        0
        • S SeMartens

          Hi Wender, I'm not really sure if the TBPerfilDataTable class needs to have a default constructor (without any parameters). If I access an object using serialization (e.g. by using a WebSerice), the serialized class always needs a constructor without parameters. Is your datatable marked as serializable ? Regards Sebastian Trying to be a .NET Programmer ;-)

          W Offline
          W Offline
          Wender Oliveira
          wrote on last edited by
          #4

          Sebastian, thanks for your attention First it throws an exception about Serializable Attribute not found, so, I marked all my datatable classes as [Serializable()]. Then, I tried again and got that exception. I tried to reimplement ISerializable interface but I didn't understande how to do this. Wender Oliveira .NET Programmer

          1 Reply Last reply
          0
          • M miah alom

            If you are deriving from the DataTable class, then you must add the following code protected MyDataTable(Serializati­onInfo info, StreamingContext context):base(info, context) { }

            W Offline
            W Offline
            Wender Oliveira
            wrote on last edited by
            #5

            Thanks, I didn't try but it seems to work. I did an workaround and now works... :-) Tks... Wender Oliveira .NET Programmer

            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