473,395 Members | 1,761 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,395 software developers and data experts.

SqlCacheDependency - repost in hopes of a reply

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.

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.

Nov 19 '05 #1
5 2409
Maybe I'm just easily confused - but are you asking about [how to
dynamically encrypt a dynamically created connection string], or how to
[dynamically create a sqlCacheDependency]? or both?

Normally I wouldn't reply if I don't understand the question - but
apparently nobody else is answering; perhaps they're confused as well. Maybe
it would help to break up this "master question" into individual other more
specific questions; one for the connection string, another for the dynamic
sqlCacheDependency. I'd take a shot at answering both here - but I don't
know the answers!

-GH
"Adrian Parker" <ap******@nospam.nospam> wrote in message
news:O2****************@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.

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.


Nov 19 '05 #2
Harry, thanks for responding..

Basically, the problem as we see it is that to use SQLCacheDependency, it
seems that you have to use a hard coded connection string in the cache
section of the web.config, which isn't going to work for us because we
cannot expose the specific database credentials to the network people who
would be specifying the DBserver and DBname to connect to; We can't have the
whole connection string in the web.config, and so have to build it in the
application at runtime e.g.

constr = "Data Source=" + aDBServer + ";Initial Catalog=" + aDBName + ";User
ID=" + aUser + ";pwd=" + aPwd

We know the user and password, but not the dbserver or dbname
and the customer network people know the dbserver and name, but not the user
or password.

So how do we use cache dependency without hard coding the connection string
in the web.config ?

Many Thanks
Adrian

"Guadala Harry" <GM**@BeansAndTacos.org> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Maybe I'm just easily confused - but are you asking about [how to
dynamically encrypt a dynamically created connection string], or how to
[dynamically create a sqlCacheDependency]? or both?

Normally I wouldn't reply if I don't understand the question - but
apparently nobody else is answering; perhaps they're confused as well.
Maybe it would help to break up this "master question" into individual
other more specific questions; one for the connection string, another for
the dynamic sqlCacheDependency. I'd take a shot at answering both here -
but I don't know the answers!

-GH
"Adrian Parker" <ap******@nospam.nospam> wrote in message
news:O2****************@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.

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.



Nov 19 '05 #3
Hi Adrian,

As for the connectionstring setting for ASP.NET 2.0's SqlDependecy caching,
it must be configured in web.config file and asp.net runtime will always
retrieve the configuration from there. En, if you do need to dynamically
specify such connectionstring setting, we can consider using the .net 2.0's
configuration api to do it in applicatino_Start event, for example:

============
void Application_Start(Object sender, EventArgs e) {
// Code that runs on application startup
Configuration config =

System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(HttpCo
ntext.Current.Request.ApplicationPath);
ConfigurationSectionGroup group =
config.SectionGroups["system.web"];
config.ConnectionStrings.ConnectionStrings.Add(
new ConnectionStringSettings( "aaa", "Data
Source=localhost;Initial Catalog=testdb;Integrated Security=True")
);

SystemWebCachingSectionGroup cachesg =
group.SectionGroups["caching"] as SystemWebCachingSectionGroup;
cachesg.SqlCacheDependency.Databases["TestDB"].ConnectionStringName
= "aaa";

config.Save();
}
================

actually the configuration api just provde the easy to use adminstation
interfaces for manipulating web.config(or app config....)

However, since it'll cause the web.config be modifed at runtime, we are
recommended to avoid using them in our application code as much as possible.

Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Adrian Parker" <ap******@nospam.nospam>
| References: <O2**************@TK2MSFTNGP15.phx.gbl>
<OO**************@TK2MSFTNGP09.phx.gbl>
| Subject: Re: SqlCacheDependency - repost in hopes of a reply
| Date: Fri, 21 Oct 2005 00:19:54 +0100
| Lines: 89
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <ep**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 82-37-128-226.cable.ubr01.telf.blueyonder.co.uk
82.37.128.226
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:132905
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Harry, thanks for responding..
|
| Basically, the problem as we see it is that to use SQLCacheDependency, it
| seems that you have to use a hard coded connection string in the cache
| section of the web.config, which isn't going to work for us because we
| cannot expose the specific database credentials to the network people who
| would be specifying the DBserver and DBname to connect to; We can't have
the
| whole connection string in the web.config, and so have to build it in the
| application at runtime e.g.
|
| constr = "Data Source=" + aDBServer + ";Initial Catalog=" + aDBName +
";User
| ID=" + aUser + ";pwd=" + aPwd
|
| We know the user and password, but not the dbserver or dbname
| and the customer network people know the dbserver and name, but not the
user
| or password.
|
| So how do we use cache dependency without hard coding the connection
string
| in the web.config ?
|
| Many Thanks
| Adrian
|
| "Guadala Harry" <GM**@BeansAndTacos.org> wrote in message
| news:OO**************@TK2MSFTNGP09.phx.gbl...
| > Maybe I'm just easily confused - but are you asking about [how to
| > dynamically encrypt a dynamically created connection string], or how to
| > [dynamically create a sqlCacheDependency]? or both?
| >
| > Normally I wouldn't reply if I don't understand the question - but
| > apparently nobody else is answering; perhaps they're confused as well.
| > Maybe it would help to break up this "master question" into individual
| > other more specific questions; one for the connection string, another
for
| > the dynamic sqlCacheDependency. I'd take a shot at answering both here
-
| > but I don't know the answers!
| >
| > -GH
| >
| >
| > "Adrian Parker" <ap******@nospam.nospam> wrote in message
| > news:O2****************@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.
| >>
| >> 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.
| >>
| >>
| >>
| >>
| >>
| >
| >
|
|
|

Nov 19 '05 #4
Steven,

So in summary, because we cannot expose the database credientials to the
network people who would be specifying the dbserver/dbname, we cannot use
SqlCacheDependency as that requires you to compromise db security by
including the credentials in the web.config, which isn't possible when they
have to be specified at runtime.

If this is the case, then you really need to change this.

Thanks
Adrian Parker

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:gx**************@TK2MSFTNGXA01.phx.gbl...
Hi Adrian,

As for the connectionstring setting for ASP.NET 2.0's SqlDependecy
caching,
it must be configured in web.config file and asp.net runtime will always
retrieve the configuration from there. En, if you do need to dynamically
specify such connectionstring setting, we can consider using the .net
2.0's
configuration api to do it in applicatino_Start event, for example:

============
void Application_Start(Object sender, EventArgs e) {
// Code that runs on application startup
Configuration config =

System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(HttpCo
ntext.Current.Request.ApplicationPath);
ConfigurationSectionGroup group =
config.SectionGroups["system.web"];
config.ConnectionStrings.ConnectionStrings.Add(
new ConnectionStringSettings( "aaa", "Data
Source=localhost;Initial Catalog=testdb;Integrated Security=True")
);

SystemWebCachingSectionGroup cachesg =
group.SectionGroups["caching"] as SystemWebCachingSectionGroup;
cachesg.SqlCacheDependency.Databases["TestDB"].ConnectionStringName
= "aaa";

config.Save();
}
================

actually the configuration api just provde the easy to use adminstation
interfaces for manipulating web.config(or app config....)

However, since it'll cause the web.config be modifed at runtime, we are
recommended to avoid using them in our application code as much as
possible.

Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Adrian Parker" <ap******@nospam.nospam>
| References: <O2**************@TK2MSFTNGP15.phx.gbl>
<OO**************@TK2MSFTNGP09.phx.gbl>
| Subject: Re: SqlCacheDependency - repost in hopes of a reply
| Date: Fri, 21 Oct 2005 00:19:54 +0100
| Lines: 89
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <ep**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 82-37-128-226.cable.ubr01.telf.blueyonder.co.uk
82.37.128.226
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:132905
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Harry, thanks for responding..
|
| Basically, the problem as we see it is that to use SQLCacheDependency,
it
| seems that you have to use a hard coded connection string in the cache
| section of the web.config, which isn't going to work for us because we
| cannot expose the specific database credentials to the network people
who
| would be specifying the DBserver and DBname to connect to; We can't have
the
| whole connection string in the web.config, and so have to build it in
the
| application at runtime e.g.
|
| constr = "Data Source=" + aDBServer + ";Initial Catalog=" + aDBName +
";User
| ID=" + aUser + ";pwd=" + aPwd
|
| We know the user and password, but not the dbserver or dbname
| and the customer network people know the dbserver and name, but not the
user
| or password.
|
| So how do we use cache dependency without hard coding the connection
string
| in the web.config ?
|
| Many Thanks
| Adrian
|
| "Guadala Harry" <GM**@BeansAndTacos.org> wrote in message
| news:OO**************@TK2MSFTNGP09.phx.gbl...
| > Maybe I'm just easily confused - but are you asking about [how to
| > dynamically encrypt a dynamically created connection string], or how
to
| > [dynamically create a sqlCacheDependency]? or both?
| >
| > Normally I wouldn't reply if I don't understand the question - but
| > apparently nobody else is answering; perhaps they're confused as well.
| > Maybe it would help to break up this "master question" into individual
| > other more specific questions; one for the connection string, another
for
| > the dynamic sqlCacheDependency. I'd take a shot at answering both here
-
| > but I don't know the answers!
| >
| > -GH
| >
| >
| > "Adrian Parker" <ap******@nospam.nospam> wrote in message
| > news:O2****************@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.
| >>
| >> 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.
| >>
| >>
| >>
| >>
| >>
| >
| >
|
|
|

Nov 19 '05 #5
Thanks for your response Adrian,

Yes, as for your scenario, i'll be hard to utilize the current
configuration model of the sqlcache. However, because the sqlcache need to
be pre configured for each application(since the asp.net runtime need to
constantly do data polling from database), we need to specify the complete
server connection info at design-time rather than runtime. Anyway, i'll
forward this request to our dev team though I think it may takes time for
them to change the current sqlcache configuration model.
Thanks for your understanding.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Adrian Parker" <ap******@nospam.nospam>
| References: <O2**************@TK2MSFTNGP15.phx.gbl>
<OO**************@TK2MSFTNGP09.phx.gbl>
<ep**************@TK2MSFTNGP12.phx.gbl>
<gx**************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: SqlCacheDependency - repost in hopes of a reply
| Date: Fri, 21 Oct 2005 07:56:50 +0100
| Lines: 199
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <uV**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 82-37-128-226.cable.ubr01.telf.blueyonder.co.uk
82.37.128.226
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:132956
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
|
| So in summary, because we cannot expose the database credientials to the
| network people who would be specifying the dbserver/dbname, we cannot use
| SqlCacheDependency as that requires you to compromise db security by
| including the credentials in the web.config, which isn't possible when
they
| have to be specified at runtime.
|
| If this is the case, then you really need to change this.
|
| Thanks
| Adrian Parker
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:gx**************@TK2MSFTNGXA01.phx.gbl...
| > Hi Adrian,
| >
| > As for the connectionstring setting for ASP.NET 2.0's SqlDependecy
| > caching,
| > it must be configured in web.config file and asp.net runtime will always
| > retrieve the configuration from there. En, if you do need to
dynamically
| > specify such connectionstring setting, we can consider using the .net
| > 2.0's
| > configuration api to do it in applicatino_Start event, for example:
| >
| > ============
| > void Application_Start(Object sender, EventArgs e) {
| > // Code that runs on application startup
| > Configuration config =
| >
| >
System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(HttpCo
| > ntext.Current.Request.ApplicationPath);
| > ConfigurationSectionGroup group =
| > config.SectionGroups["system.web"];
| > config.ConnectionStrings.ConnectionStrings.Add(
| > new ConnectionStringSettings( "aaa", "Data
| > Source=localhost;Initial Catalog=testdb;Integrated Security=True")
| > );
| >
| > SystemWebCachingSectionGroup cachesg =
| > group.SectionGroups["caching"] as SystemWebCachingSectionGroup;
| >
cachesg.SqlCacheDependency.Databases["TestDB"].ConnectionStringName
| > = "aaa";
| >
| > config.Save();
| > }
| > ================
| >
| > actually the configuration api just provde the easy to use adminstation
| > interfaces for manipulating web.config(or app config....)
| >
| > However, since it'll cause the web.config be modifed at runtime, we are
| > recommended to avoid using them in our application code as much as
| > possible.
| >
| > Thanks,
| >
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | From: "Adrian Parker" <ap******@nospam.nospam>
| > | References: <O2**************@TK2MSFTNGP15.phx.gbl>
| > <OO**************@TK2MSFTNGP09.phx.gbl>
| > | Subject: Re: SqlCacheDependency - repost in hopes of a reply
| > | Date: Fri, 21 Oct 2005 00:19:54 +0100
| > | Lines: 89
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Response
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <ep**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 82-37-128-226.cable.ubr01.telf.blueyonder.co.uk
| > 82.37.128.226
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:132905
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Harry, thanks for responding..
| > |
| > | Basically, the problem as we see it is that to use
SQLCacheDependency,
| > it
| > | seems that you have to use a hard coded connection string in the cache
| > | section of the web.config, which isn't going to work for us because we
| > | cannot expose the specific database credentials to the network people
| > who
| > | would be specifying the DBserver and DBname to connect to; We can't
have
| > the
| > | whole connection string in the web.config, and so have to build it in
| > the
| > | application at runtime e.g.
| > |
| > | constr = "Data Source=" + aDBServer + ";Initial Catalog=" + aDBName +
| > ";User
| > | ID=" + aUser + ";pwd=" + aPwd
| > |
| > | We know the user and password, but not the dbserver or dbname
| > | and the customer network people know the dbserver and name, but not
the
| > user
| > | or password.
| > |
| > | So how do we use cache dependency without hard coding the connection
| > string
| > | in the web.config ?
| > |
| > | Many Thanks
| > | Adrian
| > |
| > | "Guadala Harry" <GM**@BeansAndTacos.org> wrote in message
| > | news:OO**************@TK2MSFTNGP09.phx.gbl...
| > | > Maybe I'm just easily confused - but are you asking about [how to
| > | > dynamically encrypt a dynamically created connection string], or
how
| > to
| > | > [dynamically create a sqlCacheDependency]? or both?
| > | >
| > | > Normally I wouldn't reply if I don't understand the question - but
| > | > apparently nobody else is answering; perhaps they're confused as
well.
| > | > Maybe it would help to break up this "master question" into
individual
| > | > other more specific questions; one for the connection string,
another
| > for
| > | > the dynamic sqlCacheDependency. I'd take a shot at answering both
here
| > -
| > | > but I don't know the answers!
| > | >
| > | > -GH
| > | >
| > | >
| > | > "Adrian Parker" <ap******@nospam.nospam> wrote in message
| > | > news:O2****************@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.
| > | >>
| > | >> 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.
| > | >>
| > | >>
| > | >>
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #6

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

Similar topics

14
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant...
1
by: stewart | 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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.