0

How do you send data from an ASP.NET web application to a windows form application?? How do you establish the connection? I looked up webrequest/webresponse/post but i think thats only if you want to communicate between 2 asp.net web applications.

1
  • In previous comments you have vaguely described what the web application is doing (click a button and send to the windows form), but what is the forms application doing? Why is it a WinForms application? If all it's doing is receiving data, wouldn't a web service be a lot easier to do what you're trying to do? Please give us more information about your overall goal here, because based on this and other questions of yours it sounds like you're really over-complicating things. Commented Nov 20, 2010 at 12:41

2 Answers 2

1

You might use a socket.

It would help if you're more specific about exactly what you're trying to accomplish. Do you need live communication, or would connecting to a shared database do what you need? Is the web application on the same computer as the server or a different one from the forms application?

Update: If you're trying to pass messages to the Windows Form without using or implementing any sort of protocol, you might look into how to use LISTEN/NOTIFY on PostgreSQL. You could then just add data to a table, then have the forms application consume the data. This would have the added benefit that your forms app wouldn't have to miss any data if it was not on.

Sign up to request clarification or add additional context in comments.

3 Comments

its live. The web application will be on the internet and the windows form will be like on a home computer. The web application has button where you click and once its click, it sends data to the windows form on the home computer
Okay, figure out how the web server will know where the forms app is hosted (does the forms app subscribe to the event, or does the web app find it by some other means?) Then, read up about sockets and figure out how to make the connection/pass data. SOAP might come in handy, but I wouldn't go there before understanding the basics.
Also see my suggestion about PostgreSQL, as it seems you're trying to avoid handling your own sockets.
0

My opinion to you is to implement a webservice. I made a project for mobile devices using webservices, the mobiles had an application made in winforms that call a webmethod that made an action which was registered in the system. A web page showed the data and the events of every mobile device.

If you need an explantation of webservices you can go here.

The strategy in your case would be to implement the Observer Pattern or to raise an event to make the application or winform to be noticed about a change or action in the web page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.