Connection Issue While connecting to SqlServer 2000 from ASP.NET 2.0
-
HI I have got some error while connecting Sql Server 2000 from ASP.NEt 2.0 i.e My ASP.NET Application and SqlServer 2000 are avaliable in diffrent machine.I remotly connecting the sql server 2000. I am getting the following 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.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(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.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at _Default.click_Click(Object sender, EventArgs e) in d:\WebSite2\Default.aspx.cs:line 27" Please send me ur sugessions. Thanks Paul
-
HI I have got some error while connecting Sql Server 2000 from ASP.NEt 2.0 i.e My ASP.NET Application and SqlServer 2000 are avaliable in diffrent machine.I remotly connecting the sql server 2000. I am getting the following 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.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(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.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at _Default.click_Click(Object sender, EventArgs e) in d:\WebSite2\Default.aspx.cs:line 27" Please send me ur sugessions. Thanks Paul
Hi, can you paste your code u are using to connect to the database. The way it is usually done is pasted below for your reference The connection stings are specified in the web config file. In Web.Config, you can add a key to the AppSettings Section Example: Then, in your ASP.Net application - just refer to it like this: using System.Configuration; string connectionString = (string )ConfigurationSettings.AppSettings["ConnectionString"]; try also adding segment to your web config file. i hope this helps Renu.K
-
Hi, can you paste your code u are using to connect to the database. The way it is usually done is pasted below for your reference The connection stings are specified in the web config file. In Web.Config, you can add a key to the AppSettings Section Example: Then, in your ASP.Net application - just refer to it like this: using System.Configuration; string connectionString = (string )ConfigurationSettings.AppSettings["ConnectionString"]; try also adding segment to your web config file. i hope this helps Renu.K
Thanks for your sugession Renu, I exaclty did the same what u mentioned in the above example, but i am used to connect with sql server 2000, but the error says that sql server 2005. Is there any conflict to connedct with Sql server 2000 from ASP.NEt 2.0 remotely.
-
Thanks for your sugession Renu, I exaclty did the same what u mentioned in the above example, but i am used to connect with sql server 2000, but the error says that sql server 2005. Is there any conflict to connedct with Sql server 2000 from ASP.NEt 2.0 remotely.
-
try giving the ip address of that sql server in the web config file... hope this works..
Renu.K