*应用程序配置文件的常用写法和调用
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="DataBaseOwner" connectionString="dbo" />
<add name="MySchoolConnectionString" connectionString="Data Source=.;Initial Catalog=MySchool;User ID=sa;Password=123456"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
#region Private Members
//从配置文件中读取数据库连接字符串
private readonly string connString = ConfigurationManager.ConnectionStrings["MySchoolConnectionString"].ToString();
private readonly string dboOwner = ConfigurationManager.ConnectionStrings["DataBaseOwner"].ToString();
#endregion