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. SQL Server Connection Problem

SQL Server Connection Problem

Scheduled Pinned Locked Moved ASP.NET
helpdatabasesysadminsql-servervisual-studio
6 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.
  • K Offline
    K Offline
    kaliem
    wrote on last edited by
    #1

    Hi , I am supposed to work on an already developed project (in VS and SQL 2005). When I open this project on my machine (Project was developed on some other machine), I get the following error (on pages which are connected to DB) 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) In my web.config, Connection string goes like connectionString="DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\RealEstate.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" Anybody facing similar problem before ??? Please help then , its urgent .. Thanks Kaliem

    M 1 Reply Last reply
    0
    • K kaliem

      Hi , I am supposed to work on an already developed project (in VS and SQL 2005). When I open this project on my machine (Project was developed on some other machine), I get the following error (on pages which are connected to DB) 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) In my web.config, Connection string goes like connectionString="DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\RealEstate.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" Anybody facing similar problem before ??? Please help then , its urgent .. Thanks Kaliem

      M Offline
      M Offline
      Mircea Grelus
      wrote on last edited by
      #2

      Can you connect to the database with Windows Authentification? If not connect with SQL Server Authentification, then right click the connection in Object Explorer, go to the seurity tab and in the "Server Authentification" section select both authentification modes. If you want your db to be accessable from a remote connection you must change the default option that SQL Server 2005 has: Go to Start Programs -> sql server 2005 -> configuration tools -> Sql Server Surface Area Configuration. On the "Surface Area Configuration for Services and Connection" option, under SQLEXPRESS -> Database engine -> Remote connections, check "Local and remote connections" and then "Using Both TCP and named pipes.

      regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

      K 1 Reply Last reply
      0
      • M Mircea Grelus

        Can you connect to the database with Windows Authentification? If not connect with SQL Server Authentification, then right click the connection in Object Explorer, go to the seurity tab and in the "Server Authentification" section select both authentification modes. If you want your db to be accessable from a remote connection you must change the default option that SQL Server 2005 has: Go to Start Programs -> sql server 2005 -> configuration tools -> Sql Server Surface Area Configuration. On the "Surface Area Configuration for Services and Connection" option, under SQLEXPRESS -> Database engine -> Remote connections, check "Local and remote connections" and then "Using Both TCP and named pipes.

        regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

        K Offline
        K Offline
        kaliem
        wrote on last edited by
        #3

        SQL got installed on my machine by VS 2005 installer. Now, when I open "Surface Area Configuration for Services and Connection" as you said, "NO SQL Server 2005 components were found on this computer" :( Do I need to install VS 2005 again after un-installing SQL and VS ??? But Installer is same as before ... btw, same error appears when i open my .mdf file in VS environment ...

        M 1 Reply Last reply
        0
        • K kaliem

          SQL got installed on my machine by VS 2005 installer. Now, when I open "Surface Area Configuration for Services and Connection" as you said, "NO SQL Server 2005 components were found on this computer" :( Do I need to install VS 2005 again after un-installing SQL and VS ??? But Installer is same as before ... btw, same error appears when i open my .mdf file in VS environment ...

          M Offline
          M Offline
          Mircea Grelus
          wrote on last edited by
          #4

          kaliem wrote:

          Do I need to install VS 2005 again after un-installing SQL and VS ??? But Installer is same as before ...

          I don't understand what you mean. Have you uninstalled SQL Express?

          regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

          K 1 Reply Last reply
          0
          • M Mircea Grelus

            kaliem wrote:

            Do I need to install VS 2005 again after un-installing SQL and VS ??? But Installer is same as before ...

            I don't understand what you mean. Have you uninstalled SQL Express?

            regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

            K Offline
            K Offline
            kaliem
            wrote on last edited by
            #5

            Mircea Grelus wrote:

            Have you uninstalled SQL Express?

            No, I havent un-installed anything ... I ran VS 2005 Installer and SQL 2005 was installed by this setup. Now, I get error "No SQL Server 2005 components were found on this computer" I am asking you what should i do now ??? and btw, VS 2005 setup didnt ask me for anything (sa password or server name etc) as it happens with Manual Installation of SQL Express ...

            M 1 Reply Last reply
            0
            • K kaliem

              Mircea Grelus wrote:

              Have you uninstalled SQL Express?

              No, I havent un-installed anything ... I ran VS 2005 Installer and SQL 2005 was installed by this setup. Now, I get error "No SQL Server 2005 components were found on this computer" I am asking you what should i do now ??? and btw, VS 2005 setup didnt ask me for anything (sa password or server name etc) as it happens with Manual Installation of SQL Express ...

              M Offline
              M Offline
              Mircea Grelus
              wrote on last edited by
              #6

              Fire up SQL Express with Microsoft SQL Server Management Studio Express[^] and see how that goes. Maybe your installation of SQL Server is corrupted. Btw, do you have any other SQL Server installed? 2000? In order for two versions of SQL Server to coexist on one machine, only one can be set as default instance, the other/s must be installed as named instances.

              regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

              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