473,237 Members | 1,413 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,237 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 2402
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: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.