locked
sending dataset on sockets

    Question

  • 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,
    Wednesday, October 25, 2006 1:46 PM

All replies

  • it sounds like you want to serialize your data set.  I'm moving this over to the serialization web forum.
    Wednesday, October 25, 2006 4:28 PM
  • cant find the forum...can you send me the link ???
    Wednesday, October 25, 2006 7:11 PM
  • 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

    @Abuja, Nigeria

     

    Friday, October 27, 2006 11:19 AM
  • 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.

     

    Tuesday, October 31, 2006 6:58 AM