sql server 2000和sqlserver 2005 连接字符串的区别

最近在用2005,它的连接跟2000不一样。

在后台代码里:
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>

你可能感兴趣的:(sql,cms,Web,SQL Server,Security)