var connectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString; connectionString.Expand() // returns "server=db01.mycompany.com;uid=uid;pwd=pwd;Initial Catalog=master;"