Results 1 to 6 of 6

Thread: Sending serialization...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325

    Sending serialization...

    Before all I want to say this is a trick, because I don't know how to use remoting. Then:
    I have a dataset. I want to send it from a database (in a server) to a remote client application. What I do is serializing the dataset, and sending it over the network. I serialize the dataset in a memorystream, transform it in a string and send it through the network.
    From the other side, I get this string and deserialize, but I get an error saying that deserialization failed because some bytes were changed.
    Anyone's idea???

    Thanks,
    Xmas.
    Learn, this is the Keyword...

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    If you're working with DataSets, and you want to send the whole thing, you might as well use DataSet.WriteXML and DataSet.ReadXML.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually if you are using Remoting then it will handle all of the serialization for you, that is part of what it does. All you have to do is make a Public Function in the remoting server that returns the dataset, then in have the client call the function.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325
    Slow_Learner:
    Using Xml from DataSet was my first bet, but I realized that is not a good thing, infact if I get an empty recordset, the Xml rapresentation of this dataset is only "</newdataset>" and nothing else!!! Instead serialization gives me tables, columns, and rows if any

    Edneeis:
    I'm not using remoting because I don't know how to use it, I'm reinventing the wheel... Sending the serialized object is what remoting does.
    I read a post about remoting, downloaded code from MS, but didn't understand how to get it to work for me

    Thx Xmas.
    Learn, this is the Keyword...

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    I attempted to look at remoting, and will defintely get around to it at some point, but for just getting my application up and running, I reinvented the wheel. .. which meant putting my class definitions in both the server and the client app.... the server reading the dataset and populating an instance of my class, serializing it, and sending it down the pipe to the client.

    It works great of course, but I have a feeling learning Remoting is going to be an invaluable skill when working on team projects..especially when they will assume you already know how to do it. I agree the Microsoft tutorial leaves you with more questions... but in a few months, perhaps we'll get some nice DevX articles on the subject.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The best source on remoting is a book called 'Advanced .NET Remoting in VB.NET' or C#. Don't let the 'Advanced' bit scare you it covers all the basics as well. Its by Ingo Rammer who frequents a few newgroups and what not and has a website. Any info by that guy should be good.

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