TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Roshdy Abuzeid
NA
23
0
Add new connection string to your web application:
Dec 28 2009 3:22 AM
this topic about adding new connection string to the application at run time.
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();
Reply
Answers (
2
)
Explain the concepts of Post Cache Substitution in .NET
Are validation server controls better than javascript in any way ?