//第一种获取连接字符串的方法
string str1 = System.Configuration.ConfigurationManager.ConnectionStrings["Maticsoft"].ConnectionString;
//第二种获取连接字符串的方法
string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Maticsoft"].ToString();
//第三种获取连接字符串的方法
string str2 = System.Configuration.ConfigurationSettings.AppSettings["Maticsoft"].ToString();