1、配置數據庫鏈接字符串數據庫
<connectionStrings> <add name="CaoLPractise" connectionString="server=.;uid=sa;pwd=123456;database=CaoL.TJ.TreeShow"/> </connectionStrings>
string conString = ConfigurationManager.ConnectionStrings["CaoLPractise"].ConnectionString;