C# .NET - Connectionmanager and connectionsettings

Asked By karur krishna madhu on 03-Jul-13 07:09 AM
I have my connection string under connection string tag in web.config.when i use connection manager i can see both app settings and connection string properties in my c# code. but when I use the same connection manger in a .Cs file that is with in a class library I  am not able to see connection string using connection manger I had to change it to connection settings and access app settings and also i had to move my connection string from connection string tag to app settings tag. why cant I access connection string using a connection manager in a class file that is in a class library?
Robbe Morris replied to karur krishna madhu on 03-Jul-13 08:22 AM
Your class library methods should either have the connection string as a parameter or you should have a single method that initializes that value in a static variable.

Making class libraries dependent upon environment specific config file is not a good idea and always leads to hassles.