Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending a recordset over a data stream?

Status
Not open for further replies.

WilliamUT

IS-IT--Management
Oct 8, 2002
182
US
I am currently programming a client/server application and now am to the point where I need to send data back and forth from server to client (and vise versa). The server basically is the middle man between the client and a MySQL database. I would like the server to return a recordset and transfer that recordset over my data stream where the client can grab the recordset again and do what is needed. My question is how do I accomplish this? Do I need to serialize the recordset first and then send it? Do you have any examples?

Thanks
 
Does it need to be a stream? Or can you just send/receive the whole thing. If you can move the whole thing there are plenty of solutions. You could use a dataset to write the data to XML and then send the XML via a web request or ftp. Or you could serialize an object and send it over a direct connection between the client and server.

If you need a stream (ie: Read before last byte is received) maybe you can use some sort of network stream via a direct connection... I'm not sure, haven't played with streams very much.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
No it does not have to be in a stream. I would like it to stay in a recordset type form so I can throw it into a grid or export it to a file on the client end. Let me tell you what the program does and mabye you can tell me which one of the solutions above would best fit. The client connects to the server over the LAN or internet. On connect the server sends the client configuration data which is all held in a recordset. The user answers a set of questions on the other end and the client sends those answers back to the server which stores them in a database. I basically need this to work over whatever connection speed and not loose any data while communicating.
 
One more question. You said I could serialize an object and send it via a direct connection. Isn't this the same as over a stream? I would like a direct connection so I can see when the clients are logged on and I can also boot them off or write in a chat function etc.
 
Your best bet then is going to be to write a server/client class. There should be plent of samples available on the web, google VB.Net Chat application or something of the like. Once you have a client/server setup that can communicate, you just need to add the functionality to pass the recordset and allow remote commands(ie booting).

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
That still does not answer my question though. How do I go about sending the recordset? Right now im communications over a network stream. Mabye remoting is what I want?
 
How do you send text over the connection? You serialize the variable and write it to the stream. How do you send data over the connection? You serialize the variable and write it to the stream.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Thats the part where I get confused. Do I need to put some kind of "marker" after I send the serialized object so the client knows when it is done being sent?
 
I don't beleive so. It's been a while since I've played with network communication, but once the object is completed the listener should know. Then again, I don't recall ever sending a variable length object... hrmm. You might have to. Maybe one of the guys/gals with more net com experience will chime in.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top