srinivas_vemla
asked on
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?
Am I missing something? How can I implement Connection String way of connecting using DAAB without too many changes?
ASKER
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.
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.
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
Bob
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bob