tags:

views:

39

answers:

1

Hi,

I have started running the profiler tool in VS to see the bottlenecks in my code.

In the debug mode, before I actually get to doing something, there are about 30 requests to read the connection string from the registry. There is a variety of reasons for storing the connection string in the registry and this can't be modified.

My question is how does VS deal with caching of the connectiong string? What is being cached? How often and why? Is there a way to modify caching settings?

Thank you

+1  A: 

I'm not sure if you're talking about a website, but the web.config is cached in memory, so putting the connection string in the web.config file is efficient.

You won't get that efficiency if you use the Registry.

What are the variety of reasons for storing connection strings in the registry? I didn't know there were any...

Joe R
Hey, it's stored once and it's used by other dlls that don't have the access to web.config or app.config
vikp
Hello. If the calling application has the connection string in its own config file, the other dlls can access the config settings using the ConfigurationManager. Then there's no need to access the Registry.
Joe R