开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜