连接数据库
<connectionStrings> <add name="BookConection" connectionString="Data Source=(local);Initial Catalog=数据库名;Persist Security Info=True;User ID=登录名;Password=密码" providerName="System.Data.SqlClient" /> </connectionStrings>
string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["SqlConnStr"].ConnectionString;
protected static string connectionString = ConfigurationManager.ConnectionStrings["SqlConnStr"].ConnectionString;