|
-
Dec 25th, 2009, 08:26 PM
#1
Thread Starter
Junior Member
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!
-
Jan 15th, 2010, 09:42 AM
#2
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|