日期:2014-05-18  浏览次数:20362 次

急~!连接数据库 .net2005 sql2000
System.Data.SqlClient.SqlException:   在建立与服务器的连接时出错。在连接到   SQL   Server   2005   时,在默认的设置下   SQL   Server   不允许进行远程连接可能会导致此失败。   (provider:   SQL   网络接口,   error:   25   -   连接字符串无效)   在   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException   exception,   Boolean   breakConnection)   在   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject   stateObj)   在   System.Data.SqlClient.TdsParser.Connect(Boolean&   useFailoverPartner,   Boolean&   failoverDemandDone,   String   host,   String   failoverPartner,   String   protocol,   SqlInternalConnectionTds   connHandler,   Int64   timerExpire,   Boolean   encrypt,   Boolean   trustServerCert,   Boolean   integratedSecurity,   SqlConnection   owningObject,   Boolean   aliasLookup)   在   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection   owningObject,   SqlConnectionString   connectionOptions,   String   newPassword,   Boolean   redirectedUserInstance)   在   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity   identity,   SqlConnectionString   connectionOptions,   Object   providerInfo,   String   newPassword,   SqlConnection   owningObject,   Boolean   redirectedUserInstance)   在   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions   options,   Object   poolGroupProviderInfo,   DbConnectionPool   pool,   DbConnection   owningConnection)   在   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection   owningConnection,   DbConnectionPool   pool,   DbConnectionOptions   options)   在   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection   owningObject)   在   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection   owningObject)   在   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection   owningObject)   在   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection   owningConnection)   在   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection   outerConnection,   DbConnectionFactory   connectionFactory)   在   System.Data.SqlClient.SqlConnection.Open()   在   _Default.Button1_Click(Object   sender,   EventArgs   e)

怎么解决啊?急用.多谢

------解决方案--------------------
首先确认sa与网络访问都打开。

然后确认sql2000是否打了补丁?

没有打补丁的话在xp sp2系统下只能本机访问。安装sql sp3。
------解决方案--------------------
你在IIS配置里面配置一下asp.net吧,估计是这个的错误,编译错误中显示的是连接Sql Server 2005
------解决方案--------------------
在Visual S 2005中打开服务器资源管理器,里面有肯定有两个连接。
删了那个和SQL2005连接的。
------解决方案--------------------
以前也碰到过,SQL server2000一定要打SP3以上的补丁,还有在安装VS.NET 2005时,不要安装SQL
Serve 2005 Express