Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified)

Discussion in 'ASP .Net' started by hfk0, Mar 27, 2006.

  1. hfk0

    hfk0 Guest

    Hello,

    I'm a newbie here and was wondering anyone could help me with this.

    I have a simple ASP.NET 2 web application running perfectly fine with
    IIS and SQLServerExpress installed locally on my WinXP as a testing
    server (I created the app in Visual Studio.NET 2005).

    When deploying this app on the production server (running Win2000
    Server, IIS and SQLServerExpress 2005), I'm getting the following
    message when calling an aspx data-bound page from a browser:

    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)

    On the production server, I have the SQLServerExpress installed locally
    on C: drive and the database is located on D: drive (on the same
    directory as the app).

    Connection string used in the webconfig file:
    connectionString="Server=SERVERNAME\SQLEXPRESS;AttachDbFilename=D:\Inetpub\App_Data\registration.mdf;Database=registration;Trusted_Connection=yes;"
    providerName="System.Data.SqlClient"

    Does anyone know how to solve this issue? Any help would be greatly
    appreciated.

    Thanks,
    Harry
    hfk0, Mar 27, 2006
    #1
    1. Advertising

  2. Networking protocols are disabled by default in SQL Server Express.

    If someone simply installs Express and chooses all the defaults, SQL Server Express will only
    be able to have connections originating on the local machine where SQL Server is installed.

    You need to expressly enable networking protocols on the production server.

    Follow the instructions outlined at :

    http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
    and
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=271795&SiteID=1




    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ===================================
    "hfk0" <> wrote in message
    news:...
    > Hello,
    >
    > I'm a newbie here and was wondering anyone could help me with this.
    >
    > I have a simple ASP.NET 2 web application running perfectly fine with
    > IIS and SQLServerExpress installed locally on my WinXP as a testing
    > server (I created the app in Visual Studio.NET 2005).
    >
    > When deploying this app on the production server (running Win2000
    > Server, IIS and SQLServerExpress 2005), I'm getting the following
    > message when calling an aspx data-bound page from a browser:
    >
    > 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)
    >
    > On the production server, I have the SQLServerExpress installed locally
    > on C: drive and the database is located on D: drive (on the same
    > directory as the app).
    >
    > Connection string used in the webconfig file:
    > connectionString="Server=SERVERNAME\SQLEXPRESS;AttachDbFilename=D:\Inetpub\App_Data\registration.mdf;Database=registration;Trusted_Connection=yes;"
    > providerName="System.Data.SqlClient"
    >
    > Does anyone know how to solve this issue? Any help would be greatly
    > appreciated.
    >
    > Thanks,
    > Harry
    >
    Juan T. Llibre, Mar 27, 2006
    #2
    1. Advertising

  3. hfk0

    hfk0 Guest

    Hi Juan,

    I did enable TCP and name pipes for both local and remote connections,
    but still no luck.

    I've searched all posts related to this issue in this group but still
    haven't found a solution yet.

    I'm only using windows authentication on the production server and I
    can't even access it there, let alone remotely. Could it be that I'm
    missing something on the connection string? I've also allowed
    permission to everyone (just for the sake of testing it) on the folder
    where the database resides, which is on drive D:. Could this be a
    problem as well?
    hfk0, Mar 27, 2006
    #3
    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. olduncleamos

    Visual Studio 2005 and SqlExpress

    olduncleamos, Jul 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    395
    Juan T. Llibre
    Jul 22, 2005
  2. =?Utf-8?B?bmljaw==?=

    ASPNETDB.MDF when no SQLExpress, only SQL Server 2005?

    =?Utf-8?B?bmljaw==?=, Jun 19, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    18,844
    Jon Paal
    Jun 20, 2006
  3. jobs
    Replies:
    4
    Views:
    755
  4. juvi
    Replies:
    3
    Views:
    1,038
    Alexey Smirnov
    Jan 22, 2009
  5. Rico
    Replies:
    0
    Views:
    137
Loading...

Share This Page