Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Connection Issue While connecting to SqlServer 2000 from ASP.NET 2.0

Connection Issue While connecting to SqlServer 2000 from ASP.NET 2.0

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdatabasesql-server
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nesaraja
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • N nesaraja

      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

      R Offline
      R Offline
      RenuKhot
      wrote on last edited by
      #2

      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

      N 1 Reply Last reply
      0
      • R RenuKhot

        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

        N Offline
        N Offline
        nesaraja
        wrote on last edited by
        #3

        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.

        R 1 Reply Last reply
        0
        • N nesaraja

          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.

          R Offline
          R Offline
          RenuKhot
          wrote on last edited by
          #4

          try giving the ip address of that sql server in the web config file... hope this works..

          Renu.K

          N 1 Reply Last reply
          0
          • R RenuKhot

            try giving the ip address of that sql server in the web config file... hope this works..

            Renu.K

            N Offline
            N Offline
            nesaraja
            wrote on last edited by
            #5

            HI I Also tried this. Thanks Paul

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups