日期:2014-05-17 浏览次数:20442 次
SqlConnection cn = new SqlConnection(ConfigurationManager.AppSettings["conStr"]);
<appSettings> <add key="conStr" value="Server=PC-201204230402\SQLEXPRESS;DataBase=www;uid=sa;pwd=ldsk2323ld"/> </appSettings>
<connectionStrings> <add name="db_Blog_DataConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=E:\MSSQL2008\MSSQL10.SQLEXPRESS\MSSQL\DATA\db_Blog_Data.MDF;Integrated Security=True;User ID=sa;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings>