Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi...

I am using EnterpriseLibrary for connecting to my sql server database. Now i want dynamic connection strings for my application.
I have registered EnterpriseLibrary in my web.config with one default database.


<dataconfiguration defaultdatabase="Connection String">

I am tried by changing this connection to databaseFactory class using

String Test = ConfigurationManager.ConnectionStrings["Connection String1"].ToString();
 Database db = DatabaseFactory.CreateDatabase(Test );


for connecting to my second database. But its throwing error like 'this configuration is not configured'.

I am trying for its solution for past one week. please help on this as my full project implemented with databasefactory class. now am changing my project to get dynamic connections to connect with multiple databases.

Help me and thanks in advance.
Posted
Updated 27-Jan-14 21:45pm
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900