Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push data from Sql Server to desktop application

I have a pretty simple .net 4 desktop application written in c# which needs to display some data inserted to a table on an SQL Server (2005). The data itself is quite simple, just one row of about 10 columns, (mostly counts of other data).

I could just poll the sql server from the application every x interval, but my preference is to have the sql server push the data out to this application if possible, as the timing of the "new data" is often irregular.

In short, I'd like to know if this is possible. Doing some research before posting this question, I found a few possibilities.

1) SignalR: I found this question which seemed promising, but this seems to be in the context of a web application rather than a desktop one. Upon review of the signalR wiki, it seemed to me that it requires some kind of web service or other http connection which I'd prefer to avoid.

2) Sql server change tracking, from this question. Firstly, I'm not on sql 2008 so I assume I'd have to install or configure it (which isn't a problem) but I'm also not sure if this will provide what I need.

I will mention as well that this client application could exist on 100+ different pcs which would all need to be notified on the data change.

So, is such a thing possible? I apologize if the question is a little vague - and thanks in advance for your help!

like image 214
Mansfield Avatar asked Sep 11 '12 14:09

Mansfield


1 Answers

The SQLDependencyclass is supposed to cater to the very scenario that you are referring to. While i do not have any personal experience using this, this article seems to be in line with your scenario

like image 120
Jagmag Avatar answered Nov 15 '22 20:11

Jagmag