Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
I have 10 Clients on different network(not on LAN) .e.g one is in USA and other in UK and other in Dubai and so on. 

My server PC is in Australia and Server is using Web Application. 
My all clients PC using same Windows application and their own local DB.
Client PC can access to Server using windows Services. But my Question is that ,How Server Will get Data from Client PC using web-services or any in your mind???
Please give any good Idea with example of Sample Code ,  I want just sample code which i will write in my server side Web application and its will fetch data from Clients PC .

Thank you.
Posted
Updated 22-Nov-14 22:10pm
v3
Comments
BillWoodruff 21-Nov-14 13:37pm    
"please Don't give me any hug Theoretical link for read. I want just sample code which i will write in my server side Web application and its will fetch data from Clients PC ."

I suggest you remove this language which may be off-putting to people here. Often the best answers to questions here involve "theory," and trying to address not what the poster asks for, but what they really need to know.

For your non-web application running on client's machines ... which are not connected to the server running the ASP.NET web-app constantly (but can access the Server) ... there is no way they will get an asynchronous "push" notification from the Server.

You will have to do something on the Client side to check and see if the Server "wants" an update. The simplest way might be to use some form of Timer.

Another idea: when the client's application starts, have them check with the server to get a client-specific "message" (data) for how often they should check for an update, and every time each client updates, they can check to see if the update interval has changed, and modify the frequency of updating as needed.

Let's say that when the hypothetical timer triggers the client logs-in to the server and, first, check to see if an update is asked for: no update needed: client logs-off.

I can imagine more complex scenarios where each client at the start of their application downloads code to run that, for their machine, will determine not only the frequency of update, but other parameters that many define the structure of their data they send to the server.
 
Share this answer
 
Comments
[no name] 23-Nov-14 12:58pm    
you mean i have do some thing on client side windows application???
Ever heard of the concept "Networking[^]"?

It is a very broad topic to cover, but the short answer would be, that each and every client sends a request to your web server with its location (IP address) and the headers that make up the request, such as which resource to get what data to pass on to the server etc. The server accepts the request, and works on it. The IP address and a few more headers are usefull to check which client it is. Mostly servers use MAC addresses and bla bla. The location of your server (domain name; http://www.example.com) is registered on a DNS server, which would translate it back to an IP, that would define the location of the server to which the client needs to connect to. The data would be passed to that server using the data packets that are sent by the client.

The data is sent back to the client using the location (IP Address) he sent while making a request. Since their IP addresses are different the server would send the data related to the computer only.
 
Share this answer
 
Comments
[no name] 21-Nov-14 8:52am    
Well If clients Pc is using the router Internet .as you know Public IP always Change,its Dynamic IP .and to make its Static We need pay monthly to Head office of Internet.
If its Static IP then its not problem but due to router its Dynamic now.e.g you write on google what is my ip. its will give you a ip which change always after 24 hour..
So now tell me how can i handle this issue ??
Afzaal Ahmad Zeeshan 21-Nov-14 8:54am    
Yes, to make it static you will need to get a commercial and static IP address to get the requests to your PC (which would act as a server). There is no problem for handling it, just set your PC's Network settings in Control panel to static IP address that the ISP would give you.
[no name] 21-Nov-14 8:57am    
This is what We don't want to setting on Client PC internet . There are more than 500 Clients . and Router can change too ..
Afzaal Ahmad Zeeshan 21-Nov-14 9:00am    
You should not be doing this on the client's PC. Instead you will be changing the IP address on the server only, and on the client just update the Uri for the resource (web server). And they will start getting the data from your new IP address.
[no name] 21-Nov-14 9:02am    
Our client don't want to use setting of Internet . and i also don't think if its good idea. Please give me other solution now.
thanks Again.

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