deploying aspnetdb membership .. error: 26 - Error Locating Server/Instance

Discussion in 'ASP .Net' started by jobs, Jun 6, 2007.

  1. jobs

    jobs Guest

    Works great on my client when I test from vs.net 2005.

    Howevever, when I deploy to the web server, I get this error: remotely
    and local from the web server.

    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)

    My web config contains this:

    <connectionStrings>

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="Data Source=.
    \SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|
    aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /
    >


    </connectionStrings>

    There is no sql server install on the Web Server. I used vs.net 2005
    to create the site on my client.


    Thanks for any help or information.
     
    jobs, Jun 6, 2007
    #1
    1. Advertising

  2. re:
    !> There is no sql server install on the Web Server.

    That's your problem.

    You need, at least SQL Server 2000 or 2005 installed on the server,
    whether the Express version or the full SQL Server 2005.

    You can also use other databases, like Access.

    There's a sample Access Provider at :
    http://download.microsoft.com/downl...7-9269-dbf9edbaada8/sampleaccessproviders.vsi

    More info on the Provider model is at :
    http://msdn2.microsoft.com/en-us/asp.net/aa336558.aspx




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ======================================
    "jobs" <> wrote in message
    news:...
    > Works great on my client when I test from vs.net 2005.
    >
    > Howevever, when I deploy to the web server, I get this error: remotely
    > and local from the web server.
    >
    > 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)
    >
    > My web config contains this:
    >
    > <connectionStrings>
    >
    > <remove name="LocalSqlServer"/>
    >
    > <add name="LocalSqlServer" connectionString="Data Source=.
    > \SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|
    > aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /
    >>

    >
    > </connectionStrings>
    >
    > There is no sql server install on the Web Server. I used vs.net 2005
    > to create the site on my client.
    >
    >
    > Thanks for any help or information.
    >
     
    Juan T. Llibre, Jun 6, 2007
    #2
    1. Advertising

  3. jobs

    jobs Guest

    On Jun 6, 12:52 pm, "Juan T. Llibre" <>
    wrote:
    > re:
    > !> There is no sql server install on the Web Server.
    >
    > That's your problem.
    >
    > You need, at least SQL Server 2000 or 2005 installed on the server,
    > whether the Express version or the full SQL Server 2005.
    >



    Thank you!. Okay, I created an aspnetdb database somewhere else using
    that aspnet_reg utilitity , changed my web.config to use it, added
    users/roles and it works fine from vs.net 2005 - I renamed the local
    aspnetdb file to make sure.

    I deploy to the web server, and was getting error:

    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    so I added this to my web config (making sure that user has access to
    the new database).

    <identity impersonate="true" userName="dbserver\dbuser"
    password="dbpass"/>

    and now I'm back to the original error:

    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)

    I have other web sites on that web server accessing databases on that
    sql 2005 database server with similar web.configs with no problems,
    the difference is those websites are doing intranet windows
    authentication and this site is using logon forms authentication .

    Thanks for any more help or information!
     
    jobs, Jun 6, 2007
    #3
  4. jobs

    jobs Guest

    Some more information here.. not sure what to make of it..


    The error does not appear to happen on login page (where if I enter
    the wrong password I get the expected error meaning [i think] that it
    was able to shake hands with the database), but on the login's success
    destination page where role secuirty for "all users" is set to allow
    on it's directory.

    and if i take the impersonate line out of the web.config i get the
    error:

    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    if i enter an incorrect password and submit, but apparently on the
    login page.
     
    jobs, Jun 6, 2007
    #4
  5. jobs

    jobs Guest

    sorry. diregard comment about impersonate.. i took that out and it
    works fine from vs.net and behales the same on the web server.. here's
    the latest:

    My aspnetdb is on a remote database - created with that aspnet_req*
    utility.

    I test my login page from vs.net on my client and it works great
    taking me to the destination page with no problem.

    However, after I deploy to the webserver I test the login from the web
    server, and I can tell there is communication with the aspnetdb, as i
    get the expected login error if I enter a bad password, but if i enter
    the correct password, i get the below after about 10 seconds on the
    destinationpageurl.

    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)

    That desitination page is under a directory that has "all users" =
    allow.

    For IIS directory security on the web site I've tried every
    combination.

    windows authentication, none, basic, removing annoymous.

    It would appear the problem is when the web server tries to confirm I
    have access to that destination page/directory.

    Thanks again for any help or information.
     
    jobs, Jun 6, 2007
    #5
    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. hfk0
    Replies:
    2
    Views:
    21,748
  2. jobs
    Replies:
    1
    Views:
    420
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 21, 2007
  3. juvi
    Replies:
    3
    Views:
    1,083
    Alexey Smirnov
    Jan 22, 2009
  4. GaryC
    Replies:
    0
    Views:
    190
    GaryC
    Aug 25, 2006
  5. jobs
    Replies:
    0
    Views:
    256
Loading...

Share This Page