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

数据库 SQL Server
SQL2005中的连接和SQL2000连接不太一样,下文对这两个版本的SQL数据库中连接字符串的区别作了详尽的阐述,希望对您能有所帮助。

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"
  • 1.
  • 2.

SQL2005:

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

在web.config里:
sql 2000:

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

sql 2005:   

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

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

 

 

 

【编辑推荐】

SQL Server连接超时的处理方法

SQL Server连接数的查询

深入了解Sqlserver运行参数

SQL SERVER线程和纤程的配置

多台SQL Server服务器管理

责任编辑:段燃 来源: 互联网
点赞
收藏

51CTO技术栈公众号