webconfig文件中:
<connectionStrings>
<add name="ConnectionString" connectionString="server=6ACEF0A01FD740E;uid=sa;pwd=sa;database=HNSalary"/>
</connectionStrings>
在程序中:
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString