質問

I m new to tcp client server applications in c#. I want to pass data table from server to client over the network (between 2 pc's). Plz help by giving me some reference.

役に立ちましたか?

解決

You need to do two different things:

  1. Set up a working tcp server and client. There are lots of tutorials for this task, e.g. http://tech.pro/tutorial/704/csharp-tutorial-simple-threaded-tcp-server

  2. Serialize the data table to send it over network, convert the serialized data to a byte array (Convert class). How to serialize a DataTable to a string?

他のヒント

There are may ways to achieve this. You need to know what you are working with (which you have not put in your question).

If it's SQL Server, Oracle, DB2, MySQL or any other RDMBS, then there are lots of examples you can search for using Google ("how to query a table in MSSQL").

If your server is a proprietary setup, then you need to tell us what that that setup is, specifically.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top