Results 1 to 2 of 2

Thread: Sending Data Tables over TCP?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2009
    Location
    Milton Keynes
    Posts
    29

    Sending Data Tables over TCP?

    I have started my first client server application in VB.NET i have used some code from MSDN for a basic client server application which can send a string over the stream by converting it into bytes which is then retranslated at the other side.

    It seems pretty simple so far however i need to be able to send more useful objects over the stream such as data tables from my sql server... Is there a way for me to convert my data table into bytes to be reconstructed at the other side?

    Thanks!

  2. #2
    Addicted Member
    Join Date
    Dec 2005
    Posts
    198

    Re: Sending Data Tables over TCP?

    Yes, it's called serialization. Basically, what you do is to convert an object into an array of bytes and send over the net this array. In the other side you convert back the array into the object. It's important that both sides have the same object's data type, otherwise deserialization will fail. My approach to that is to make a dll file that has all the objects that will be sent over the network. Then in your server and client project you just need to add a reference to the dll file to make them visible.
    I hope it helps!.

    Regards.

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