SQL2000中的连接字符串和SQL2005连接字符串不一样,下面就为您介绍SQL2005连接字符串和SQL2000中的区别,供您参考。
在后台代码里:
- SQL 2000:
- static string StrConn = "workstation id=202.134.127.77;data source=202.134.127.77;initial catalog=Yellowpage;user id=sa;password=grt2006";
SQL2005:
- con = new SqlConnection(@"Server=.\SQLExpress;Database=db_CMS;Persist Security Info=True;User ID=sa;Password=Masslong");
在web.config里:
sql 2000:
- <connectionStrings>
- <add name="RateSystemConnectionString" connectionString="Data Source=.;Initial Catalog=RateSystem;User ID=sa Pwd=sa"
- providerName="System.Data.SqlClient" />
- </connectionStrings>
sql 2005:
- <connectionStrings>
- <add name="BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=BookShop;Integrated Security=True"
- providerName="System.Data.SqlClient" />
- </connectionStrings>
以上SQL2005连接字符串和SQL2000中的区别介绍。
【编辑推荐】