sending dataset on sockets  
Author Message
bilalso





PostPosted: .NET Remoting and Runtime Serialization, sending dataset on sockets Top

Hi,
I am using framework 1.1 and VS 2003
I have a dataset that I want to pass over socket. How can I do this any sample
Also, on the recieving end, how can I convert it back from binary to dataset.

Thanks,


.NET Development4  
 
 
Mike Flasko





PostPosted: .NET Remoting and Runtime Serialization, sending dataset on sockets Top

it sounds like you want to serialize your data set. I'm moving this over to the serialization web forum.

 
 
bilalso





PostPosted: .NET Remoting and Runtime Serialization, sending dataset on sockets Top

cant find the forum...can you send me the link

 
 
Victor Egbe





PostPosted: .NET Remoting and Runtime Serialization, sending dataset on sockets Top

The forum should be here!

My solution for you would be to work with XML in a Dataset.

Step 1: Convert your dataset to XML at the sending end thus.

dsMyDataset.WriteXML("C:\myFile.xml")

A new file will be created with name myFile.xml on drive C. You then can transmit this file over your socket.

Step 2: Convert XML to Dataset at the receiving end thus.

dsMyDataSet.Clear

dsMyDataset.ReadXML ("C:\myFile.xml")

The WriteXML method have options for writing and raeding the XML schema = > XMLWriteMode.WriteSchema.

For more details I will refer you to this document.

vbADOXML.exe

You can download it from:

http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet0625002.asp frame

Should this link not work, simply go to the

http://msdn.microsoft.com/library/en-us

and serch for the vbADOXML.exe file.

Hope this will help...

Vie



 
 
Glenn Block MSFT





PostPosted: .NET Remoting and Runtime Serialization, sending dataset on sockets Top

Datasets are binarily serializable. If you are using a socket you can simply serialize the DataSet using the BinaryFormatter class. Once it is serialized to a binary stream, you can send the stream accross the wire via your socket, and then deserialize on the other side back to a DataSet.