the user will fill the (connection name, machine name or IP, database name, login ID, login password)
Add this code to the button event handler:
string connectionStringName = txtNewConn.Text;string connectionString = "Password=" + txtPassword.Text + ";Persist Security Info=True;User ID=" + txtUserLogin.Text + ";Initial Catalog=" + txtDBName.Text + ";Data Source=" + txtIP.Text;
ConnectionStringSettings Settings = new ConnectionStringSettings(connectionStringName, connectionString);
Settings.ProviderName = "System.Data.SqlClient";
var cfg = WebConfigurationManager.OpenWebConfiguration(@"/");
cfg.ConnectionStrings.ConnectionStrings.Add(Settings);
cfg.Save();
Roshdy AbuzeidPosted Dec 29, 2009, 10:14 AM
But it was closed and I was submitted the solution
Kirtan PatelPosted Dec 28, 2009, 3:27 AM