posted 3/12/2007 5:51:42 AM by Vivek Thakur
using System.Configuration; class A { /// <summary> /// Returns the connection string from the web.config file /// </summary> /// <returns></returns> public static string GetConnectionString() { ///<remarks> ///Get the DB Connection String from web.config ///</remarks> return ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); }
Vivek Thakur (Member since: 11/27/2008 11:54:25 AM) I am one of the administrators at CodeAsp.Net and I love programming, architecting solutions, code reviews, teaching and writing about ASP.NET.
View Vivek Thakur 's profile
Leave a comment
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address: