SqlCacheDependency

S

stewart

I've got the standard SqlCacheDependency working just fine , ie. I've
defined (and encrypted) the connectionStrings section in the web.config, and
I've also defined an an sqlCacheDependency in the caching section. So, in my
code I add an item to the cache with an sqlCacheDependency, referencing the
named sqlCacheDependency in the web.config and the database table it is to
be based on (have enabled notificiations for that table). Fine.

What I'd like to do however is too dynamically build the connection strings
and define the sqlCacheDependencies dynamically as well (ie not in the
web.config), although thats thats too important, it's the connection string
I'm really interested in.
 
S

stewart

oops. preesed ctrl return accidently !!

I've got the standard SqlCacheDependency working just fine , ie. I've
defined (and encrypted) the connectionStrings section in the web.config,
and I've also defined an an sqlCacheDependency in the caching section. So,
in my code I add an item to the cache with an sqlCacheDependency,
referencing the named sqlCacheDependency in the web.config and the
database table it is to be based on (have enabled notificiations for that
table). Fine.

What I'd like to do however is to dynamically build the connection strings
and define the sqlCacheDependencies dynamically as well (ie not in the
web.config), although thats thats too important, it's the connection
string I'm really interested in.

I've been on the web, even had a look at the .net classes using the
reflector.exe. I've tried creating a SqlCacheDependencyDatabase dynamically
but when I try and reference it by name in the constructor for
sqlCacheDependency it can't find it because it's only looking at ones that
have been loaded from the web.config.

The reason the connection strings have to be dynamically created is that the
app is deployed on several different client sites, and they have control
over the db server and the db name, but we need to keep the user name and
password to ourselves. We already build our connection strings dynamically
for normal db stuff. We have a custom section within the web config where
the client puts the db server and the db name.

It doesn't seem like such an strange thing to want to do, either I'm missing
something or it's harder than it should be.

Any ideas ??

Thanks

Stewart Bellamy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top