A user puts in some input from a Web Asp.Net application. I want that data to be available to an Asp.Net standalone application that is running as a Service.
My original plan is for the two applications to use the same database. Web writes into UserInputTable. Service checks the UserInputTable every few seconds, and if there's input, it processes it.
This works, but feels horribly inefficent. Could I have the two somehow share a static variable, or use the same Application container? Or can I pass data directly between the two processes, like c++ does with a pipe?
I've never done IPC with C# like this, so a good design article would also be a great answer. =)
Asp.Net standalone application that is running as a Service.
I mean it's a Windows Form, that has a class file that extends ServiceBase. The class runs as a Windows Service, installed ie: InstallUtil /i DBDaemon.exe
I'm confused. You are running one ASP.NET application in IIS, but what do you mean by "ASP.NET standalone application"? I assume you mean a Windows service. If so, writing/reading to a SQL database is quite common for this scenario and I've seen it used
all the time in production apps. If by "horribly inefficient" you mean 100 milliseconds, well, then yeah. For most applications this delay is fine. If it's not, I'd suggest rearchitecting your solution from scratch.
Here you can create a Windows service and schedule that service according to your requirement, which will check your database after a fixed time of interval, if it find some data to process then it can perform required operation on data.
To perform this functionality you need to add one more field in your data table (or you can create a new table like tblDataProcessed), that will use to mark the record like which record is processed or which one is not. On the bases of this field Windows
Service will identify which record is processed and which one is required to process.
Let me know if you need any other help on this.
Pradeep Kr. Sharma
http://vshelpdesk.blogspot.com/
Please Mark As Answer, which helped you. So that it might be useful for others.
halcyon1234
Member
32 Points
45 Posts
Share data between Web and Application?
Jan 13, 2012 02:05 PM|LINK
A user puts in some input from a Web Asp.Net application. I want that data to be available to an Asp.Net standalone application that is running as a Service.
My original plan is for the two applications to use the same database. Web writes into UserInputTable. Service checks the UserInputTable every few seconds, and if there's input, it processes it.
This works, but feels horribly inefficent. Could I have the two somehow share a static variable, or use the same Application container? Or can I pass data directly between the two processes, like c++ does with a pipe?
I've never done IPC with C# like this, so a good design article would also be a great answer. =)
Thanks!
ignatandrei
All-Star
134871 Points
21618 Posts
Moderator
MVP
Re: Share data between Web and Application?
Jan 13, 2012 02:38 PM|LINK
I think it's good communication. You can have also a file on disk. Or you try WCF
What do you mean by
halcyon1234
Member
32 Points
45 Posts
Re: Share data between Web and Application?
Jan 13, 2012 05:10 PM|LINK
I mean it's a Windows Form, that has a class file that extends ServiceBase. The class runs as a Windows Service, installed ie: InstallUtil /i DBDaemon.exe
Matt in Camb...
Member
39 Points
24 Posts
Re: Share data between Web and Application?
Jan 13, 2012 05:43 PM|LINK
I'm confused. You are running one ASP.NET application in IIS, but what do you mean by "ASP.NET standalone application"? I assume you mean a Windows service. If so, writing/reading to a SQL database is quite common for this scenario and I've seen it used all the time in production apps. If by "horribly inefficient" you mean 100 milliseconds, well, then yeah. For most applications this delay is fine. If it's not, I'd suggest rearchitecting your solution from scratch.
ignatandrei
All-Star
134871 Points
21618 Posts
Moderator
MVP
Re: Share data between Web and Application?
Jan 14, 2012 04:25 AM|LINK
This is not ASP.NET application
However, you should read about WCF. Is for communications.
Horizon_Net
Star
8277 Points
1435 Posts
Re: Share data between Web and Application?
Jan 14, 2012 10:08 AM|LINK
Hi,
like said above you should go for WCF. Here's a nice tutorial for it.
If my post solves your problem, please mark as answer.
Pradeep Kr. ...
Participant
1712 Points
294 Posts
Re: Share data between Web and Application?
Jan 14, 2012 06:11 PM|LINK
Here you can create a Windows service and schedule that service according to your requirement, which will check your database after a fixed time of interval, if it find some data to process then it can perform required operation on data.
To perform this functionality you need to add one more field in your data table (or you can create a new table like tblDataProcessed), that will use to mark the record like which record is processed or which one is not. On the bases of this field Windows Service will identify which record is processed and which one is required to process.
Let me know if you need any other help on this.
http://vshelpdesk.blogspot.com/
Please Mark As Answer, which helped you. So that it might be useful for others.