C# .Net 1.1 DAAB - Connecting using ConnectionString and not Configuration File

I am using C# .Net 1.1 Data Access Application Block from Enterprise Library. Till today I was fine with using it and specifying my connection details in a Configuration file. But a new requirement came that the Connection String should be specified from the Database and not a file. But in DAAB, I don't see a method that takes a connection string as a parameter and gets me a connection.

Am I missing something? How can I implement Connection String way of connecting using DAAB without too many changes?
srinivas_vemlaAsked:
Who is Participating?
 
Bob LearnedCommented:
This is a little Enterprise Library review, since I don't use it.  The DatabaseFactory.CreateDatabase doesn't have a way of specifying a connection string that isn't in the configuration file.

Bob
0
 
Bob LearnedCommented:
Now, that doesn't sound like a very smart decision, but whatever!!  How can you connect to a database to get the connection for the same database (doesn't make any sense)?

Bob
0
 
srinivas_vemlaAuthor Commented:
No They these two are different databases. One database will have connection strings that I should be using. I will set the connection string for this database in the config file.

But a table in this database will have connection strings for all other databases and some other settings. I should be using these entries to connect to them.

I hope I am clear this time.
0
 
Bob LearnedCommented:
Ok, that sounds a little better--that is something that you can achieve.  Use the connection string, and ExecuteScalar to execute a query and get the connection string back to the other database.

Bob
0
 
srinivas_vemlaAuthor Commented:
So if I get a connection and change it's connection string to something else, it will automatically connect to the other database? Is that all needed?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.