473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

SqlCacheDependency

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.


--
Stewart Bellamy
Ingenuity@work
Nov 19 '05 #1
1 2832
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

--
Stewart Bellamy
Ingenuity@work
"stewart" <st*****@nospam.co.uk> wrote in message
news:ul**************@TK2MSFTNGP15.phx.gbl... 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.


--
Stewart Bellamy
Ingenuity@work

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Adrian Parker | last post by:
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...
5
by: Joel Barsotti | last post by:
I'm trying to get sql cache dependency working correctly. I've got sql server 2005 for my back end. I've don the "ALTER DATABASE dbName SET broker_enable" command. I made sure the user in my...
1
by: Yosi | last post by:
Hi, I have a wierd problem about the SqlCacheDependency class. It just works for a couple of minutes. After 2 minutes or more, the cache does not expire anymore. I'm using SQL Server 2005 as...
2
by: chris | last post by:
Hello all, Background: Using .NET 2.0, Sql Server 2005, SqlCacheDependency is utilized successfully against SqlCommand objects elsewhere in the code (in other words I have successful instances...
10
by: J055 | last post by:
Hi I've been trying out SqlCacheDependency using the ObjectDataSource and SQL Server 2005. It all works quite well with the minimum of configuration, e.g. <asp:ObjectDataSource...
0
by: KUTTAN | last post by:
Dim SCD As New SqlCacheDependency("StorePaq", "Product") I am trying to declaire an SqlCacheDependency as above BUT I am getting an error as follows “Cannot find the 'StorePaq' database in...
4
by: Reinout | last post by:
Hi I set up a sql cache dependency, but always receive a "DependencyChanged" notification straight away (through CacheItemRemoved callback). Modifying the procedure didn't help me. It used to...
1
by: mark4asp | last post by:
Help: SQLCacheDependency not working. When I step through my code with the debugger I notice that the condition below: (cacheItem == null) is always true. I have setup SQLCacheDependency...
1
by: | last post by:
Hey Guys, I have been struggling with this for few days. when i use SqlCacheDependency sqlDependency=new SqlCacheDependency("test","dbo.USStates"); where test is the name of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.