Hi there,
I am currently developing an ASP.NET program that connects to a SQL Server
2000 database. I also have SQL Server 2005 Express installed on the same
local machine.
Prior to installing SQL Server 2005, my apps were working and is connecting
flawlessly to a database on the SQL Server 2000. Now, whenever I connect to
the same database with the 2005 version installed, I keep on getting this
error:
---------------------------------------
System.Data.SqlClient.SqlException: An error has occurred while establishing
a connection to the server. When connecting to SQL Server 2005, this failure
may be caused by the fact that under the default settings SQL Server does not
allow remote connections. (provider: Named Pipes Provider, error: 40 - Could
not open a connection to SQL Server) at
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception,
Boolean breakConnection) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj) at 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) at
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) at
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) at
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options) at
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) at
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) at
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) at
System.Data.SqlClient.SqlConnection.Open() at
SovWebApp.Library.DataSourceAccess.GetSingleData(S tring query, Boolean
isStoredProc, DataSourceFields[] parameters) in C:\_Documents\Work
Files\Conservation\SovWebIntranetApps\SovWebLibrar y\DataSourceAccess.cs:line
72 at SovWebApp.Conservation.Logic.ConservationLogic.Get UserID(String
userName) in C:\_Documents\Work
Files\Conservation\SovWebIntranetApps\Conservation \BusinessLayer\ConservationLogic.cs:line
50 at SovWebApp.Conservation.Logic.ConservationLogic.Val idateUserID(String
userName, Int32& userID) in C:\_Documents\Work
Files\Conservation\SovWebIntranetApps\Conservation \BusinessLayer\ConservationLogic.cs:line
61 at SovWebApp.Conservation.UI.Conservation.Page_Load(O bject sender,
EventArgs e) in c:\_documents\work
files\conservation\sovwebintranetapps\conservation \conservationform.aspx.cs:line 86
-------------------------------
I have tried enabling my named pipes as well as my tcp/ip for both SQL
Servers, and I still keep on getting the same error.
I have tried checking my connection string and it seems it is correct.
<add key="DBConnection" value="Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=Conservation;Data Source=(local)"/>
My Sql Server 2005's named instance is: (local)\SQLExpress
Please help! I really don't know what to do....
Thank you so much!