public static string CONNECTION_STRING = ""; public static string getconnection() { if (CONNECTION_STRING.Trim() == "") { CONNECTION_STRING = ConfigurationManager.ConnectionStrings["BloggingDatabase"].ConnectionString; } return CONNECTION_STRING; } }