Membership provider does not connect to db

Discussion in 'ASP .Net' started by Carlos, Dec 9, 2006.

  1. Carlos

    Carlos Guest

    Hi all,

    I am trying to figure out how to deal with the membership provider.
    I used the aspnet_regsql to create the aspnetdb database in my sqlserver2005
    instance of my server. I noticed that the web.config file got updated with
    the
    entries that include the connnectionString.

    However, when I try to test the connection (i.e. AspNetSqlProvider), I do
    get:

    Could not establish a connection to the database.
    If you have not yet created the SQL Server database, exit the Web Site
    Administration tool, use the aspnet_regsql command-line utility to create
    and configure the database, and then return to this tool to set the
    provider.

    I se the database created using my Microsoft SQL Server Management Studio,
    The connection string looks fine in web.config i.e.:

    <remove name="LocalSqlServer" />

    <add name="LocalSqlServer" connectionString="Data
    Source=server\SQLSERVER2005;Initial Catalog=aspnetdb;Integrated
    Security=SSPI;"

    providerName="System.Data.SqlClient" />



    When I tried the security tab on the tool I got:

    An error occurred while attempting to initialize a
    System.Data.SqlClient.SqlConnection object. The value that was provided for
    the connection string may be wrong, or it may contain an invalid syntax.
    Parameter name: connectionString

    I do have another connectionString that points to the application data, and
    resides in the same sql server instance, and works fine. I can see the
    aspnedb as part of the databases in the instance.

    Thanks in advance for any help,



    Carlos.
     
    Carlos, Dec 9, 2006
    #1
    1. Advertisements

  2. Does the ASP.Net user account have permissions to login and view the
    aspnetdb? That's usually the biggest issue when using integrates security in
    the connection string.
     
    Mark Fitzpatrick, Dec 9, 2006
    #2
    1. Advertisements

  3. Carlos

    Carlos Guest

    Mark,

    thank you for your help. I just saw your note, and wanted to reply to you.
    Yes, I have the ASP .Net user account (NT AUTHORITY\NETWORK SERVICE), and
    <myserver>\ASPNET accounts in the db_owner role.

    Thanks again,

    Carlos.
     
    Carlos, Dec 10, 2006
    #3
  4. Carlos

    Mohsin Rizvi Guest

    Hello Carlos!

    Thanx for putting up an issue.
    I assume that you have assigned proper rights to 'NT AUTHORITY\NETWORK
    SERVICE' user account.
    Secondly, try omitting domain name from the datasource of
    connectionString attribute.

    And if it doesn't work, do paste your web.config here so we can have a
    close look in to your problem.

    Do let me know in any case.
    Regards,
    Mohsin Rizvi
     
    Mohsin Rizvi, Dec 11, 2006
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.