1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Connection Error

Discussion in 'Visual Basic ( VB )' started by Rabi, May 9, 2007.

  1. Rabi

    Rabi New Member

    Joined:
    Mar 15, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Hi everybody

    I need help in an issue, as below.

    After installing Visual Studio 2005, with SQL Server Express, on my PC; when I try to add a new connection it reports the following error:

    "An error has occurred while establishing a connection to the server. When connecting to the 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 Pipe Provider, error: 40 - could not open a connection to SQL Server)"

    I am using the following parameters:

    Data Source: Microsoft SQL Server (SqlClient)
    Server name: Desktop ( this is the name of my PC)
    Attach a database file: test.mdf (it is just for an example)

    I have un-installed and re-installed the application twice but the problem persists.

    I would appreciate any help.

    Regards,

    Raabi
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Why don't you connect using the server name instead of named pipe?
     
  3. Rabi

    Rabi New Member

    Joined:
    Mar 15, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I am using a more straightforward "Add Connection" dialogbox.

    Also, I noticed that the installation of the SQL Server did not offer me to provide or suggest the Server name and thus the default Server name is used.

    I request for a more professional opinion. I am not after getting around this problem only; but want to know the cause and remedy for such a situation.
     
  4. imp0steur

    imp0steur New Member

    Joined:
    Jul 20, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    make sure you sqlserver is running .. then check wth is the instance name ..
    In visual studio goto

    tools --> options --> DataBase *** ( It may b different .. I am on linux now .. so cant say where's the option .. search a bit )

    here for Sql server instance name .. change it to your sql server instance name .. then click ok ..
     
  5. SIKO

    SIKO New Member

    Joined:
    Oct 26, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Web Application Developper
    Location:
    Mars
    Uninstall them, then install Sql Server 2005 first which will contain the Microsft Visual Studio 2005 before u install that from the original cd try openin a connection which will work after that install the visual studio 2005 in order to get all the MSDN but microsoft Server 2005 will contain the visual studio 2005.
     

Share This Page