I have a connection class that I use to connect to my database, every time I do a select, insert, etc... statement. I have the connection string hard coded in the class.
The issue with this is, if I have to change database servers, then I have to change the string on every application, and republish.
Here is my connection string:
var cnnString = string.Format("user id=sa;" +
"password=pw;server=database\\instance;" +
"database=dbase; " +
"connection timeout=10");
I thought about creating a table and storing the database info in there, but that doesn't help if can't use the connection class to select from the database.
Is there a way of doing this dynamically?