Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I need to learn how to send a command from one c# application to another server application that will return data from a database. I have never done anything server related before and don't know what to look for. Can anyone point me in the right direction please.
Posted

You can use socket. It will be need two program, one for client & other server. Server program connected to the data base. Client program know the server ip address & port. When the client program need the data, it request the server program for the data. If the server program see that it is a valid request then he take data from the data base & serve to the client program.
You can see this


Click

Click

Click
 
Share this answer
 
I haven't done network code in C# for some time, but here's a good place to start-

http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/1/

It's a two-part article (there should be a link to the second one on that page somewhere) so be sure to read both.
Also note that it was written some time ago, so some of the code may be out of date.
If the example given doesn't work, try searching around MSDN to see if there are updated versions of the methods/classes used.

Hope this helps get you started!
 
Share this answer
 
Comments
Neil Cross 14-Oct-10 4:02am    
Thanks I appreciate the help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900