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
Sumi D
NA
4
4.3k
Couldnot add connection string to web config file
Nov 27 2011 11:39 PM
I am doing a automatic db connection when a setup file is installing in the system.
There checking db connection string in web config file.if no connectionstring the adding connectionstring value to web config file.
using this code,it is working in local system but when I configure in IIS .and I am browsing the aspx page from there ,The connection string is adding somewhere but not in web config file.
System.Configuration.ConnectionStringSettings connection = new System.Configuration.ConnectionStringSettings("helloConnectionstring5", constr, "System.Data.SqlClient");
var settings = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(@"/");
settings.ConnectionStrings.ConnectionStrings.Add(connection);
settings.Save();
Global.StartupType = Global.STARTUP_TYPE.NORMAL;
lblstatus.Text = "Connection success and connectionstring updated in webconfig";
it is the code i am using
plz help me
Reply
Answers (
0
)
Coding a (for loop) for raising a power
Export to Excel from Multiple datasets in Class Library