Configuring SqlCacheDependency in code. Is it possible?
I have the following web.config setting:
<caching>
<sqlCacheDependency enabled="true">
<databases>
<add name="MyDB" pollTime="5000" connectionStringName="MyConnString"/>
</databases>
</sqlCacheDependency>
</caching>
Now, for various reasons, I need to set this in code instead and also replace the connectionStringName with the actual connectionString (there are no connection strings defined in the web.config file).
Using System.Data.SqlClient.SqlDependency.Start(...) in 开发者_运维百科Global.asax is not an option.
Anyone know if this is possible?
精彩评论