سؤال

I guess the answer is no, but I'm asking anyway: SQL Server 2005 and later supports the implementation of live views on queries through the service broker mechanism. The .NET class SqlDependency uses this facility. SQL Server CE doesn't support it.

I'm wondering: If there's any edition of SQL Server I'd want to have live views on queries, it's going to be CE, isn't it? After all, that's the one I will most likely want to run a responsive, interactive GUI against. Is there an alternative mechanism to implement live views on queries with CE or do have make due with polling?

هل كانت مفيدة؟

المحلول

You can bind your GUI against SqlCeResultSet, which is a live cursor over the underlying data.

نصائح أخرى

SQL CE is an in-process server. Therefore you don't have the issue of concurrent access and the difficult problem of detecting changes made by other processes. On the big SQL Server this problem is addressed by Query Notifications, leveraged in the client by SqlDependency and friends.

Since in SQL CE case there will be only one process changing the data (your process!) you will always know when/what data changed and you can refresh your views accordingly.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top