Error while trying to establish connection to SQL Server from MSVS2008

Discussion in 'ASP .Net' started by S_K, Mar 24, 2010.

  1. S_K

    S_K Guest

    Hi,

    I hope you can help me with this I've been working on this all day!
    I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    was a part of this install (on the same laptop). When I tried to
    create a connection to this database engine I got the error:

    A network-related or instance-specific error occurred while
    establishing a connection to SQL Server. The server was not found or
    was not accessible. Verify that the instance name is correct and that
    SQL Server is configured to allow remote connections. (provider: Named
    Pipes Provider, error: 40 - Could not open a connectin to SQL Server)

    I've tried to configure the Remote connections to accept named pipes
    and TCP/IP but that seems to do no good.

    Is there something I'm missing here? SQL Server is running and it's on
    the same machine so there can't be a network error.

    Thanks for your help!

    Steve
     
    S_K, Mar 24, 2010
    #1
    1. Advertising

  2. S_K

    Andy B. Guest

    Re: Error while trying to establish connection to SQL Server from MSVS 2008

    "S_K" <> wrote in message
    news:...
    > Hi,
    >
    > I hope you can help me with this I've been working on this all day!
    > I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    > was a part of this install (on the same laptop). When I tried to
    > create a connection to this database engine I got the error:
    >
    > A network-related or instance-specific error occurred while
    > establishing a connection to SQL Server. The server was not found or
    > was not accessible. Verify that the instance name is correct and that
    > SQL Server is configured to allow remote connections. (provider: Named
    > Pipes Provider, error: 40 - Could not open a connectin to SQL Server)
    >
    > I've tried to configure the Remote connections to accept named pipes
    > and TCP/IP but that seems to do no good.
    >
    > Is there something I'm missing here? SQL Server is running and it's on
    > the same machine so there can't be a network error.
    >
    > Thanks for your help!
    >
    > Steve

    It's somewhere in the config manager, but check to see that local
    connections are turned on. I had the same problem with 2005 and 2008 when I
    first started.
     
    Andy B., Mar 24, 2010
    #2
    1. Advertising

  3. S_K

    Paul Shapiro Guest

    Re: Error while trying to establish connection to SQL Server from MSVS 2008

    "Andy B." <> wrote in message
    news:...
    >
    > "S_K" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I hope you can help me with this I've been working on this all day!
    >> I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    >> was a part of this install (on the same laptop). When I tried to
    >> create a connection to this database engine I got the error:
    >>
    >> A network-related or instance-specific error occurred while
    >> establishing a connection to SQL Server. The server was not found or
    >> was not accessible. Verify that the instance name is correct and that
    >> SQL Server is configured to allow remote connections. (provider: Named
    >> Pipes Provider, error: 40 - Could not open a connectin to SQL Server)
    >>
    >> I've tried to configure the Remote connections to accept named pipes
    >> and TCP/IP but that seems to do no good.
    >>
    >> Is there something I'm missing here? SQL Server is running and it's on
    >> the same machine so there can't be a network error.
    >>
    >> Thanks for your help!
    >>
    >> Steve

    > It's somewhere in the config manager, but check to see that local
    > connections are turned on. I had the same problem with 2005 and 2008 when
    > I first started.


    SQL Server defaults to disabling TCP/IP connections and Named Pipe
    connections. You need to enable the connection type(s) you want in SQL
    Configuration Manager. If you want to allow access from other machines you
    probably need to open the necessary ports in the Windows firewall.
     
    Paul Shapiro, Mar 24, 2010
    #3
  4. S_K

    S_K Guest

    Re: Error while trying to establish connection to SQL Server fromMSVS 2008

    On Mar 24, 5:33 am, "Paul Shapiro" <>
    wrote:
    > "Andy B." <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    >
    >
    > > "S_K" <> wrote in message
    > >news:....
    > >> Hi,

    >
    > >> I hope you can help me with this I've been working on this all day!
    > >> I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    > >> was a part of this install (on the same laptop). When I tried to
    > >> create a connection to this database engine I got the error:

    >
    > >> A network-related or instance-specific error occurred while
    > >> establishing a connection to SQL Server. The server was not found or
    > >> was not accessible. Verify that the instance name is correct and that
    > >> SQL Server is configured to allow remote connections. (provider: Named
    > >> Pipes Provider, error: 40 - Could not open a connectin to SQL Server)

    >
    > >> I've tried to configure the Remote connections to accept named pipes
    > >> and TCP/IP but that seems to do no good.

    >
    > >> Is there something I'm missing here? SQL Server is running and it's on
    > >> the same machine so there can't be a network error.

    >
    > >> Thanks for your help!

    >
    > >> Steve

    > > It's somewhere in the config manager, but check to see that local
    > > connections are turned on. I had the same problem with 2005 and 2008 when
    > > I first started.

    >
    > SQL Server defaults to disabling TCP/IP connections and Named Pipe
    > connections. You need to enable the connection type(s) you want in SQL
    > Configuration Manager. If you want to allow access from other machines you
    > probably need to open the necessary ports in the Windows firewall.- Hide quoted text -
    >
    > - Show quoted text -


    OK,

    I have used the Configuration Manager and set in the Log on tab "Log
    in as:" Built in account and Local system.
    I have also used the Surface Area Configuration Manager to set the
    SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
    I only want to access this SQLEXPRESS database from this (local)
    machine so I don't care much about remote connections.

    So I restarted the database engine and I still get the same error
    message!
    Ideas? Does Microsoft have tech support for installation of Visual
    Studio 2008 Professional Edition???
     
    S_K, Mar 24, 2010
    #4
  5. S_K

    Andy B. Guest

    Re: Error while trying to establish connection to SQL Server from MSVS 2008

    "S_K" <> wrote in message
    news:...
    On Mar 24, 5:33 am, "Paul Shapiro" <>
    wrote:
    > "Andy B." <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    >
    >
    > > "S_K" <> wrote in message
    > >news:...
    > >> Hi,

    >
    > >> I hope you can help me with this I've been working on this all day!
    > >> I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    > >> was a part of this install (on the same laptop). When I tried to
    > >> create a connection to this database engine I got the error:

    >
    > >> A network-related or instance-specific error occurred while
    > >> establishing a connection to SQL Server. The server was not found or
    > >> was not accessible. Verify that the instance name is correct and that
    > >> SQL Server is configured to allow remote connections. (provider: Named
    > >> Pipes Provider, error: 40 - Could not open a connectin to SQL Server)

    >
    > >> I've tried to configure the Remote connections to accept named pipes
    > >> and TCP/IP but that seems to do no good.

    >
    > >> Is there something I'm missing here? SQL Server is running and it's on
    > >> the same machine so there can't be a network error.

    >
    > >> Thanks for your help!

    >
    > >> Steve

    > > It's somewhere in the config manager, but check to see that local
    > > connections are turned on. I had the same problem with 2005 and 2008
    > > when
    > > I first started.

    >
    > SQL Server defaults to disabling TCP/IP connections and Named Pipe
    > connections. You need to enable the connection type(s) you want in SQL
    > Configuration Manager. If you want to allow access from other machines you
    > probably need to open the necessary ports in the Windows firewall.- Hide
    > quoted text -
    >
    > - Show quoted text -


    OK,

    I have used the Configuration Manager and set in the Log on tab "Log
    in as:" Built in account and Local system.
    I have also used the Surface Area Configuration Manager to set the
    SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
    I only want to access this SQLEXPRESS database from this (local)
    machine so I don't care much about remote connections.

    So I restarted the database engine and I still get the same error
    message!
    Ideas? Does Microsoft have tech support for installation of Visual
    Studio 2008 Professional Edition???

    1. Go to start>Microsoft SQL Server 2008>Configuration tools>SQL Server
    configuration.
    2. Go to SQL Server configuration(Local)>SQL Server network
    configuration>Protocols for SQLEXPRESS.
    3. In the list of protocols, make sure that shared memory is enabled, TCP/IP
    is enabled and Named pipes is enabled.
    4. In the tree, go to SQL Server services and make sure that SQLEXPRESS is
    running automatically by logging into the nt authority\Network Service
    account. This is essential because the server wont even run if this isn't
    set up right. [found this out from bad experiences].
    5. If you have SQL Server with advanced services, make sure the fulltext
    deamon launcher is enabled and set to auto start from nt authority\network
    service.
    6. Make sure SQL Server browser is enabled and set to auto start from nt
    authority\network service account. This makes it possible to not need port
    numbers in connection strings.
    7. When all changes are made, restart your computer.
    8. When computer starts, start SSMS.
    9. decide if you want to use the built in SA account, you want to create an
    sql login or use your windows account for access to the server.
    10. Whichever one you decide, make sure it is secure. I.E. it can't be
    tampered with from the outside (or inside depending on your circumstances).
    -If using SA, just sign in with that username and password.
    - If creating a username/password, give it SA rights.
    - if using windows login username/password, create the windows username in
    the server and give it SA rights.
    11. Ultimately, you should only give the user you will use just enough
    rights to get the job done. You also might want to create username/passwords
    with different levels so you can test different contexts of your databases.
    12. You should be good to go.
    13. Use computerName\InstanceName as the servername when connecting with
    SSMS or in your connection strings.
     
    Andy B., Mar 25, 2010
    #5
  6. Re: Error while trying to establish connection to SQL Server fromMSVS 2008

    On Mar 25, 6:34 am, "Andy B." <> wrote:
    > "S_K" <> wrote in message
    >
    > news:...
    > On Mar 24, 5:33 am, "Paul Shapiro" <>
    > wrote:
    >
    >
    >
    >
    >
    > > "Andy B." <> wrote in message

    >
    > >news:...

    >
    > > > "S_K" <> wrote in message
    > > >news:....
    > > >> Hi,

    >
    > > >> I hope you can help me with this I've been working on this all day!
    > > >> I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    > > >> was a part of this install (on the same laptop). When I tried to
    > > >> create a connection to this database engine I got the error:

    >
    > > >> A network-related or instance-specific error occurred while
    > > >> establishing a connection to SQL Server. The server was not found or
    > > >> was not accessible. Verify that the instance name is correct and that
    > > >> SQL Server is configured to allow remote connections. (provider: Named
    > > >> Pipes Provider, error: 40 - Could not open a connectin to SQL Server)

    >
    > > >> I've tried to configure the Remote connections to accept named pipes
    > > >> and TCP/IP but that seems to do no good.

    >
    > > >> Is there something I'm missing here? SQL Server is running and it's on
    > > >> the same machine so there can't be a network error.

    >
    > > >> Thanks for your help!

    >
    > > >> Steve
    > > > It's somewhere in the config manager, but check to see that local
    > > > connections are turned on. I had the same problem with 2005 and 2008
    > > > when
    > > > I first started.

    >
    > > SQL Server defaults to disabling TCP/IP connections and Named Pipe
    > > connections. You need to enable the connection type(s) you want in SQL
    > > Configuration Manager. If you want to allow access from other machines you
    > > probably need to open the necessary ports in the Windows firewall.- Hide
    > > quoted text -

    >
    > > - Show quoted text -

    >
    > OK,
    >
    > I have used  the Configuration Manager and set in the Log on tab "Log
    > in as:" Built in account and Local system.
    > I have also used the Surface Area Configuration Manager to set the
    > SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
    > I only want to access this SQLEXPRESS database from this (local)
    > machine so I don't care much about remote connections.
    >
    > So I restarted the database engine and I still get the same error
    > message!
    > Ideas? Does Microsoft have tech support for installation of Visual
    > Studio 2008 Professional Edition???
    >
    > 1. Go to start>Microsoft SQL Server 2008>Configuration tools>SQL Server
    > configuration.


    Well, he didn't say about "Microsoft SQL Server 2008". He installed
    2005 bundled with VS.NET
     
    Alexey Smirnov, Mar 25, 2010
    #6
  7. Re: Error while trying to establish connection to SQL Server fromMSVS 2008

    On Mar 24, 3:35 am, S_K <> wrote:
    > Hi,
    >
    > I hope you can help me with this I've been working on this all day!
    > I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    > was a part of this install (on the same laptop). When I tried to
    > create a connection to this database engine I got the error:
    >
    > A network-related or instance-specific error occurred while
    > establishing a connection to SQL Server. The server was not found or
    > was not accessible. Verify that the instance name is correct and that
    > SQL Server is configured to allow remote connections. (provider: Named
    > Pipes Provider, error: 40 - Could not open a connectin to SQL Server)
    >
    > I've tried to configure the Remote connections to accept named pipes
    > and TCP/IP but that seems to do no good.
    >
    > Is there something I'm missing here? SQL Server is running and it's on
    > the same machine so there can't be a network error.
    >
    > Thanks for your help!
    >
    > Steve


    Look at the following post
    http://www.sqlmusings.com/2009/03/1...hile-establishing-a-connection-to-sql-server/

    Hope this helps
     
    Alexey Smirnov, Mar 25, 2010
    #7
  8. S_K

    Andy B. Guest

    Re: Error while trying to establish connection to SQL Server from MSVS 2008

    "Alexey Smirnov" <> wrote in message
    news:...
    On Mar 25, 6:34 am, "Andy B." <> wrote:
    > "S_K" <> wrote in message
    >
    > news:...
    > On Mar 24, 5:33 am, "Paul Shapiro" <>
    > wrote:
    >
    >
    >
    >
    >
    > > "Andy B." <> wrote in message

    >
    > >news:...

    >
    > > > "S_K" <> wrote in message
    > > >news:...
    > > >> Hi,

    >
    > > >> I hope you can help me with this I've been working on this all day!
    > > >> I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
    > > >> was a part of this install (on the same laptop). When I tried to
    > > >> create a connection to this database engine I got the error:

    >
    > > >> A network-related or instance-specific error occurred while
    > > >> establishing a connection to SQL Server. The server was not found or
    > > >> was not accessible. Verify that the instance name is correct and that
    > > >> SQL Server is configured to allow remote connections. (provider:
    > > >> Named
    > > >> Pipes Provider, error: 40 - Could not open a connectin to SQL Server)

    >
    > > >> I've tried to configure the Remote connections to accept named pipes
    > > >> and TCP/IP but that seems to do no good.

    >
    > > >> Is there something I'm missing here? SQL Server is running and it's
    > > >> on
    > > >> the same machine so there can't be a network error.

    >
    > > >> Thanks for your help!

    >
    > > >> Steve
    > > > It's somewhere in the config manager, but check to see that local
    > > > connections are turned on. I had the same problem with 2005 and 2008
    > > > when
    > > > I first started.

    >
    > > SQL Server defaults to disabling TCP/IP connections and Named Pipe
    > > connections. You need to enable the connection type(s) you want in SQL
    > > Configuration Manager. If you want to allow access from other machines
    > > you
    > > probably need to open the necessary ports in the Windows firewall.- Hide
    > > quoted text -

    >
    > > - Show quoted text -

    >
    > OK,
    >
    > I have used the Configuration Manager and set in the Log on tab "Log
    > in as:" Built in account and Local system.
    > I have also used the Surface Area Configuration Manager to set the
    > SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
    > I only want to access this SQLEXPRESS database from this (local)
    > machine so I don't care much about remote connections.
    >
    > So I restarted the database engine and I still get the same error
    > message!
    > Ideas? Does Microsoft have tech support for installation of Visual
    > Studio 2008 Professional Edition???
    >
    > 1. Go to start>Microsoft SQL Server 2008>Configuration tools>SQL Server
    > configuration.


    Well, he didn't say about "Microsoft SQL Server 2008". He installed
    2005 bundled with VS.NET

    blah... It's practlically the same thing...
     
    Andy B., Mar 25, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jestan
    Replies:
    3
    Views:
    397
  2. ashjas
    Replies:
    7
    Views:
    358
    ashjas
    Dec 10, 2007
  3. Jerry C
    Replies:
    8
    Views:
    1,844
    Luke Zhang [MSFT]
    Jun 16, 2006
  4. Toze
    Replies:
    0
    Views:
    169
  5. Harry
    Replies:
    2
    Views:
    722
    Robert Ireland
    Oct 22, 2007
Loading...

Share This Page