|
-
May 10th, 2003, 10:10 AM
#1
Thread Starter
Hyperactive Member
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...
-
May 10th, 2003, 11:03 AM
#2
Fanatic Member
If you're working with DataSets, and you want to send the whole thing, you might as well use DataSet.WriteXML and DataSet.ReadXML.
-
May 10th, 2003, 12:41 PM
#3
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.
-
May 11th, 2003, 05:11 AM
#4
Thread Starter
Hyperactive Member
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...
-
May 11th, 2003, 07:54 AM
#5
I wonder how many charact
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.
-
May 11th, 2003, 05:46 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|