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
Nilesh Dhande
NA
11
6.4k
How to update app.config file
Apr 4 2014 3:29 AM
Hello
i am working on windows application in C#.now i want change connection string in app.confing through programitically using following code
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");
connectionStringsSection.ConnectionStrings["AdminDBConn"].ConnectionString = "Data Source=" + serverName + ";Initial Catalog=" + DbName + ";UID=" + userName + ";password=" + Password + "";
config.Save();
ConfigurationManager.RefreshSection("connectionStrings");
connection string save but when application is close then and again open then he picked up old connection string mean app.config does not update permantelly.
Reply
Answers (
3
)
Exporting Crystal Report to Pdf
Convert an imange into Black and white Image