none
Error While Establishing Connection to the Server. RRS feed

  • Question

  • Greetings,

     

    I am running Visual Studio 2005 under Windows XP Professional SP 2. 

     

    I have created a new project and now want to add a new data source.  The data source is a .mdb file:

     

    C:\Data\Adv VB Data Files\StudentData\SQL Server Files\Pubs.mdf

     

    After I select 'Microsoft SQL Server Database File' and browse to the .mdf, I get the following error mssage:

     

    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)

     

    The connection string built, looks like this:

     

    Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Data\Adv VB Data Files\StudentData\SQL Server Files\Pubs.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True

     

    Regards,

    Dave

    Sunday, October 7, 2007 8:29 PM

Answers

  • Posting to this forum enabled me to answer my own question. 

     

    When I installed Visual Studio 2005, SQL Server 2005 Express Edition did not install.  I realized this when I when to Add/Remove programs, clicked on VS Studio, and did not see SQL Server 2005 Express Edition on the Maintenance form. 

     

    So I then installed SQL Server 2005 Express from the free download off of the MS website. 

     

    And now I can connect to the server from VS!

     

    Many thanks to the contributors of this forum. 

    Friday, October 12, 2007 12:39 AM

All replies

  • Can u check this site, this may help you

     

    http://www.aquesthosting.com/HowTo/Sql2005/SQLError26.aspx

    Tuesday, October 9, 2007 4:36 AM
  • Hi Devender,

     

    No that site doesn't help me.  I don't know how or where to get at any SQL Server utilities.   

     

    Let me explain...

     

    I have Visual Studio 2005 Professional Studio installed on my PC.  My understanding is that MS SQL Server Express came with the installation. 

     

    But I don't see any MS SQL Exrpess Server controls anywhere in Visual Studio. 

     

    In this scenario, where do I look change the default settings of SQL server?

     

    Regards,

    Dave

     

    Thursday, October 11, 2007 12:56 AM
  • You could install management tools for Express edition downloading Management Studio from here

     

    https://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

     

    It will install required tools to change network settings using graphical tools.

     

    Thursday, October 11, 2007 10:12 AM
    Moderator
  • Posting to this forum enabled me to answer my own question. 

     

    When I installed Visual Studio 2005, SQL Server 2005 Express Edition did not install.  I realized this when I when to Add/Remove programs, clicked on VS Studio, and did not see SQL Server 2005 Express Edition on the Maintenance form. 

     

    So I then installed SQL Server 2005 Express from the free download off of the MS website. 

     

    And now I can connect to the server from VS!

     

    Many thanks to the contributors of this forum. 

    Friday, October 12, 2007 12:39 AM