SQL2005连接字符串和SQL2000中的区别


  本文标签:SQL2005连接字符串

  SQL2000中的连接字符串和SQL2005连接字符串不一样,下面就为您介绍SQL2005连接字符串和SQL2000中的区别,供您参考  。

  在后台代码里:

  1. SQL 2000:  
  2. static string StrConn = "workstation id=202.134.127.77;data source=202.134.127.77;initial catalog=Yellowpage;user id=sa;password=grt2006"

  SQL2005:

  1. con = new SqlConnection(@"Server=.\SQLExpress;Database=db_CMS;Persist Security Info=True;User ID=sa;Password=Masslong"); 

  在web.config里:
sql 2000:

  1. <connectionStrings> 
  2.     <add name="RateSystemConnectionString" connectionString="Data Source=.;Initial Catalog=RateSystem;User ID=sa Pwd=sa" 
  3.         providerName="System.Data.SqlClient" /> 
  4. connectionStrings> 

  sql 2005:   

  1.  <connectionStrings> 
  2.          <add name="BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=BookShop;Integrated          Security=True" 
  3. providerName="System.Data.SqlClient" /> 
  4. connectionStrings> 

  以上SQL2005连接字符串和SQL2000中的区别介绍  。