SQLDependency timeout

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

How to set up dependency so that it will never expire?

If time-out = 0, it indicates that the server's time-out should be used.
What is it? How can I set up server's time out?

All I want it is, that SQLDependency will not expire while my application is
running.

Thanks,

Lubomir
 
Lubomir said:
Hi,

How to set up dependency so that it will never expire?

If time-out = 0, it indicates that the server's time-out should be used.
What is it? How can I set up server's time out?

All I want it is, that SQLDependency will not expire while my application is
running.

Thanks,

Lubomir

Hi Lubomir,
There are two ways to define SQLDependency:

1) OutputCache
http://msdn2.microsoft.com/en-us/library/hdxfb6cy.aspx

Sample code:
<%@ OutputCache Duration="10″ VaryByParam="*"
SqlDependency="[sqldependencyname]:[tablename]" %>

2) DataSourceControl
http://msdn2.microsoft.com/en-us/library/system.web.ui.datasourcecontrol.aspx

Sample code:
<asp:SqlDataSource EnableCaching="true" CacheDuration="Infinite"
SqlCacheDependency="[sqldependencyname]:[tablename]" … />

Choose the one that fits your needs best and in addition follow the
discussion here (could be interesting for you):
http://forums.asp.net/t/1122982.aspx

HTH,
Petar Atanasov
http://a-wake.net
 
Back
Top