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. Database & SysAdmin
  3. Database
  4. Trouble connecting to SQl server 2005

Trouble connecting to SQl server 2005

Scheduled Pinned Locked Moved Database
helpdatabasesql-serversysadminsecurity
12 Posts 6 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.
  • M Offline
    M Offline
    mrkeivan
    wrote on last edited by
    #1

    Hi guys, I've got this problem, hope someone can help me out. I've written and application and it works fine on my computer and i can connect to SQL through a Text file connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True As I said, it works fine on my computer but NOT on other computers !!! I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get 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) A friend from here suggested: By default, SQL Server blocks remote access. To get round this, log into SQL Server Configuration Manager and make sure that you have enabled Named Pipes. Then, go into the Surface Area Configuration Tool and make sure it's set for Local and/or remote connections for Named Pipes. Now, restart the SQL Server instance. I did that but still get the same error !!! what should I do ??? Thanx

    K P P M M 5 Replies Last reply
    0
    • M mrkeivan

      Hi guys, I've got this problem, hope someone can help me out. I've written and application and it works fine on my computer and i can connect to SQL through a Text file connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True As I said, it works fine on my computer but NOT on other computers !!! I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get 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) A friend from here suggested: By default, SQL Server blocks remote access. To get round this, log into SQL Server Configuration Manager and make sure that you have enabled Named Pipes. Then, go into the Surface Area Configuration Tool and make sure it's set for Local and/or remote connections for Named Pipes. Now, restart the SQL Server instance. I did that but still get the same error !!! what should I do ??? Thanx

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      I am guessing that your servername is incorrect. On the machine that it is not working on, try ping the server name. If you are using something like localhost that for sure would not work on remote systems. If you can't ping the sql server, then you might have a name resolution issue which would be solved with a DNS entry on your network. Hope that helps. Ben

      M 1 Reply Last reply
      0
      • M mrkeivan

        Hi guys, I've got this problem, hope someone can help me out. I've written and application and it works fine on my computer and i can connect to SQL through a Text file connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True As I said, it works fine on my computer but NOT on other computers !!! I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get 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) A friend from here suggested: By default, SQL Server blocks remote access. To get round this, log into SQL Server Configuration Manager and make sure that you have enabled Named Pipes. Then, go into the Surface Area Configuration Tool and make sure it's set for Local and/or remote connections for Named Pipes. Now, restart the SQL Server instance. I did that but still get the same error !!! what should I do ??? Thanx

        P Offline
        P Offline
        Pratyush_k
        wrote on last edited by
        #3

        Check these two things, it might help: 1. Add SQL Server instance to the permitted list of applications in the firewall settings (Control Panel-> Security) 2. Check if port 1434 is not block using telnet 1434. Regards, Pratyush Shukla

        ssssssssssss

        1 Reply Last reply
        0
        • M mrkeivan

          Hi guys, I've got this problem, hope someone can help me out. I've written and application and it works fine on my computer and i can connect to SQL through a Text file connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True As I said, it works fine on my computer but NOT on other computers !!! I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get 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) A friend from here suggested: By default, SQL Server blocks remote access. To get round this, log into SQL Server Configuration Manager and make sure that you have enabled Named Pipes. Then, go into the Surface Area Configuration Tool and make sure it's set for Local and/or remote connections for Named Pipes. Now, restart the SQL Server instance. I did that but still get the same error !!! what should I do ??? Thanx

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          One more thing to check - make sure that you are using the database instance name, if any.

          Deja View - the feeling that you've seen this post before.

          M 1 Reply Last reply
          0
          • P Pete OHanlon

            One more thing to check - make sure that you are using the database instance name, if any.

            Deja View - the feeling that you've seen this post before.

            M Offline
            M Offline
            mrkeivan
            wrote on last edited by
            #5

            Hi, How can I check my database instance name ??? Mr.K

            1 Reply Last reply
            0
            • K kubben

              I am guessing that your servername is incorrect. On the machine that it is not working on, try ping the server name. If you are using something like localhost that for sure would not work on remote systems. If you can't ping the sql server, then you might have a name resolution issue which would be solved with a DNS entry on your network. Hope that helps. Ben

              M Offline
              M Offline
              mrkeivan
              wrote on last edited by
              #6

              Hey, how can I fix this resolution issue thing ??? Mr.K

              K 1 Reply Last reply
              0
              • M mrkeivan

                Hey, how can I fix this resolution issue thing ??? Mr.K

                K Offline
                K Offline
                kubben
                wrote on last edited by
                #7

                Can you ping the ip address or sql server name? Ben

                M 1 Reply Last reply
                0
                • M mrkeivan

                  Hi guys, I've got this problem, hope someone can help me out. I've written and application and it works fine on my computer and i can connect to SQL through a Text file connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True As I said, it works fine on my computer but NOT on other computers !!! I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get 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) A friend from here suggested: By default, SQL Server blocks remote access. To get round this, log into SQL Server Configuration Manager and make sure that you have enabled Named Pipes. Then, go into the Surface Area Configuration Tool and make sure it's set for Local and/or remote connections for Named Pipes. Now, restart the SQL Server instance. I did that but still get the same error !!! what should I do ??? Thanx

                  M Offline
                  M Offline
                  Mike Dimmick
                  wrote on last edited by
                  #8

                  Adding another issue, you may not be able to use Integrated Security (Windows Authentication) if the server and client are not members of the same domain. If they are not, the user running the client needs to have a Windows account on the server and the passwords need to be the same. Also, your database server will need to grant the CONNECT privilege to the user or to a group that the user belongs to, and the login will need to be mapped to a user in the database you're trying to use, with appropriate rights for what you're trying to do.

                  Stability. What an interesting concept. -- Chris Maunder

                  M 1 Reply Last reply
                  0
                  • M Mike Dimmick

                    Adding another issue, you may not be able to use Integrated Security (Windows Authentication) if the server and client are not members of the same domain. If they are not, the user running the client needs to have a Windows account on the server and the passwords need to be the same. Also, your database server will need to grant the CONNECT privilege to the user or to a group that the user belongs to, and the login will need to be mapped to a user in the database you're trying to use, with appropriate rights for what you're trying to do.

                    Stability. What an interesting concept. -- Chris Maunder

                    M Offline
                    M Offline
                    mrkeivan
                    wrote on last edited by
                    #9

                    The thing is this is all happening on one computer, I'm soot running it on a server then connect to it with clients. everything is on one computer !

                    1 Reply Last reply
                    0
                    • K kubben

                      Can you ping the ip address or sql server name? Ben

                      M Offline
                      M Offline
                      mrkeivan
                      wrote on last edited by
                      #10

                      It's not on a server, everything 's on a single computer ! so i don't think I can ping the IP ! Mr.K

                      K 1 Reply Last reply
                      0
                      • M mrkeivan

                        It's not on a server, everything 's on a single computer ! so i don't think I can ping the IP ! Mr.K

                        K Offline
                        K Offline
                        kubben
                        wrote on last edited by
                        #11

                        If everything is on a single computer, you probably don't want to put in the ip address, but you still would need to put the sql server name. You should still be able to create an odbc connection to it and the test connection should work. Ben

                        1 Reply Last reply
                        0
                        • M mrkeivan

                          Hi guys, I've got this problem, hope someone can help me out. I've written and application and it works fine on my computer and i can connect to SQL through a Text file connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True As I said, it works fine on my computer but NOT on other computers !!! I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get 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) A friend from here suggested: By default, SQL Server blocks remote access. To get round this, log into SQL Server Configuration Manager and make sure that you have enabled Named Pipes. Then, go into the Surface Area Configuration Tool and make sure it's set for Local and/or remote connections for Named Pipes. Now, restart the SQL Server instance. I did that but still get the same error !!! what should I do ??? Thanx

                          M Offline
                          M Offline
                          mghiassi
                          wrote on last edited by
                          #12

                          Hi, You should connect to SQL Server by SQL Server Authentication(User sa) and not Windows Authentication.

                          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