Click here to Skip to main content
15,887,849 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good morning to all codeproject expert. I need some help down here to access controls value (Textbox, DatagridView) of server_side application from client_side application over TCP. How can I do this ?

Looking for some ideas and maybe code or links that lead me to this.

Well My server is connected with a local database where its saving all information into the database. And reflecting its value to server_controls like TEXTBOX, DATAGRIDVIEW.

I want to access those datagridview values from client.

Ty codeproject for teaching me.

What I have tried:

I have tried two separate projects client and server and send messages over TCP\IP.
Shared file over TCP\IP. but when Im trying to read datagridvalue its give no output.
Code:
0 To DataGridView1.Rows.Count() - 1 Step +1
For j As Integer = 0 To DataGridView2.Rows.Count() - 1 Step +1
Next

DataGridView2.Rows.Add(DataGridView1.Rows(i).Cells(0).Value.ToString(),
DataGridView1.Rows(i).Cells(1).Value.ToString(),
DataGridView1.Rows(i).Cells(2).Value.ToString())
Posted
Updated 6-Mar-18 17:40pm

1 solution

You're not going to do it like that.

First, the very odd thing is that you even have UI controls in a server application.

You cannot reference the controls used in the server app in your client application AT ALL. You cannot be concerned with the controls in the server app. The ONLY way you're going to do this is the server app has to expose a command interface over TCP/IP, kind of like a CMD prompt. Your client sends a command to the server app and the server responds with a serialized copy of the data. It actually has nothing to do with the controls at all.

Your client app then deserializes the data and shows whatever it wants in its own controls.
 
Share this answer
 
Comments
Babai JermenKeller Sasmal 7-Mar-18 4:36am    
Sounds like this gonna solve my problem. Can you provide some examples or link ? My server is connected to a SQL Database file (.mdf) and server application datagridview populated with its value. So all I need those data can be seen through client.
Dave Kreskowiak 7-Mar-18 8:10am    
There's plenty of examples on the web and a bunch of different ways to do this. Just Google for "VB.NET TCP/IP".

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