In my project, I have a method that should return a ConnectionStringSettings object. Since the database and server name will change dynamically, I need to dynamically build the connection string.
How to convert string to ConnectionStringSettings ?
public ConnectionStringSettings getConnection(string server, string database) {
- web.config
<add name="myConnString" connectionString="server={0};Initial Catalog={1};uid=user1;pwd=blah; Connection Timeout = 1000"/>
Henry source share