Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Pushing data to clients

Author  Topic 

wattiswitnit
Starting Member

1 Post

Posted - 2007-06-08 : 07:29:38
I am someting of a newbie to SQL Server, but I am an experienced C++/C# programmer.

I have a SQL Server 2005 DB to which are connected 50 or so clients.
The clients are running my software, written in C# and connected to the server by an OleDBConnection.
These connections are long-lived; in some cases they remain for days or more.
Now and again, one of the clients causes a change to the DB (not structural, just normal adds, update and deletes).
But most of the time the clients are just viewing data in the DB.

What I need to happen is that when any item of information changes, the display of that information on any of the clients which are viewing it must be updated quickly.
It doesn't have to be instant, but a delay or more than, say, 5 seconds is unacceptable.

It is like a share-dealing or foreign exchange system (although that is not what it is) where the traders' screens have to have up-to-date information at all times.
Note that the information received by the clients does not have to describe the change in detail, just a hint to the client as to what change has happened so that the client can refresh its views.

I can think of a way of doing this but it is really nasty.
The hints would be recorded in a time-stamped table. Each client would poll every couple of seconds by calling a SP, which would return the hints which have been added since the last time that client polled.
But polling is horrible and I am sure that there must be a better way.

A route that looks promising is InfoMessages. But, reading around the subject, it looks like these cannot be unsolicited and spontaneous; they only arrive on a Connection as a result of some action on that Connection.

I may have missed something, or maybe InfoMessages are not the way to go.
Can anyone offer me any advice, please

TIA,
Paul

uberman
Posting Yak Master

159 Posts

Posted - 2007-06-08 : 07:39:34
No idea if this is what you are looking for but I read this not 10mins ago!

http://www.asp.net/learn/dataaccess/tutorial61vb.aspx?tabid=63
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-08 : 07:43:58
1. If you're so experienced with .net then you should know that the best way to connect to sql server
is with SqlConnection.
2. Don't keep your connections open. close them as soon as you can. open connection lead to performance degradation.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-08 : 07:49:14
May be SQL Server Notification services is what you want:

[url]http://msdn2.microsoft.com/en-us/library/ms172483(SQL.90).aspx[/url]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -