Sunday, December 25, 2011

Reading web.config from Timer Job



Reading web.config from Timer Job. to read the connection string from the Web.config of the Web Application
Configuration config=System.Web.Configuration.WebConfigurationManager.
OpenWebConfiguration("/",SPContext.Current.Web.Site.WebApplication.Name);
 
 string  _sqlConnectionString = config.ConnectionStrings.
ConnectionStrings["DBConnectionString"].ToString();