Using the Security section of ASP.NET Configuration in Visual Studio 2008

Discussion in 'ASP .Net' started by Nathan Sokalski, Jan 12, 2009.

  1. I am using the Membership feature of ASP.NET 3.5 in Visual Studio 2008 with
    SQL Server 2005 Developer Edition. I have created the database in SQL Server
    2005 (which is located on my local machine) and run aspnet_regsql to create
    the appropriate database objects. However, when I go to Project -> ASP.NET
    Configuration in Visual Studio 2008 and go to the Security section, I
    recieve the following error message:


    There is a problem with your selected data store. This can be caused by an
    invalid server name or credentials, or by insufficient permission. It can
    also be caused by the role manager feature not being enabled. Click the
    button below to be redirected to a page where you can choose a new data
    store.

    The following message may help in diagnosing the problem: Unable to connect
    to SQL Server database.


    I am not sure why I am recieving this error. I think my connection string in
    my Web.config is correct, but I am not sure how to find out for sure. I am
    not extremely experienced in database administration, can someone please
    help me figure out what I am doing wrong? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
    Nathan Sokalski, Jan 12, 2009
    #1
    1. Advertising

  2. Nathan Sokalski

    Uri Dimant Guest

    Hi
    Did you configure SQL Server to accept remote connections?
    Can you show us the exact error message taken from ERROR.LOG?


    "Nathan Sokalski" <> wrote in message
    news:...
    >I am using the Membership feature of ASP.NET 3.5 in Visual Studio 2008 with
    >SQL Server 2005 Developer Edition. I have created the database in SQL
    >Server 2005 (which is located on my local machine) and run aspnet_regsql to
    >create the appropriate database objects. However, when I go to Project ->
    >ASP.NET Configuration in Visual Studio 2008 and go to the Security section,
    >I recieve the following error message:
    >
    >
    > There is a problem with your selected data store. This can be caused by an
    > invalid server name or credentials, or by insufficient permission. It can
    > also be caused by the role manager feature not being enabled. Click the
    > button below to be redirected to a page where you can choose a new data
    > store.
    >
    > The following message may help in diagnosing the problem: Unable to
    > connect to SQL Server database.
    >
    >
    > I am not sure why I am recieving this error. I think my connection string
    > in my Web.config is correct, but I am not sure how to find out for sure. I
    > am not extremely experienced in database administration, can someone
    > please help me figure out what I am doing wrong? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    Uri Dimant, Jan 12, 2009
    #2
    1. Advertising

  3. Nathan Sokalski

    SURFThru.com Guest

    Re: Using the Security section of ASP.NET Configuration in Visual

    I have this same issue. I am using VS 2008, SQL 2005 and SQL is set to allow
    remote connections. I ran aspnet_regsql.exe to create the data store.

    When I go back into the Web Site Administration Tool I still get the
    following:

    There is a problem with your selected data store. This can be caused by an
    invalid server name or credentials, or by insufficient permission. It can
    also be caused by the role manager feature not being enabled. Click the
    button below to be redirected to a page where you can choose a new data
    store.

    The following message may help in diagnosing the problem: Unable to connect
    to SQL Server database.
    SURFThru.com, Jan 29, 2009
    #3
  4. Nathan Sokalski

    SURFThru.com Guest

    Re: Using the Security section of ASP.NET Configuration in Visual

    I found the issue, but what I did to make this work is not right.

    1. Look at the machine.config you will see the following connectoin string.
    <add name="LocalSqlServer" connectionString="data
    source=.\SQLEXPRESS;Integrated
    Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
    Instance=true" providerName="System.Data.SqlClient"/>

    This is what The Config Wizard uses to connect. I have SQL 2005 on my
    machine so the connection fails.

    2. I changed the connection string to:

    <add name="LocalSqlServer" connectionString="Data Source=MYLOCALSERVER;
    initial catalog=MYDB_TEST;Integrated Security=True"
    providerName="System.Data.SqlClient"/>

    And now.... the wizard works... but this is not right. Change the web.config
    each time so that you can connect using this tool, ah, something is missing
    here.
    SURFThru.com, Jan 29, 2009
    #4
  5. Nathan Sokalski

    SURFThru.com Guest

    Re: Using the Security section of ASP.NET Configuration in Visual

    #2 should have read "Change the connection string in the machine.config each
    time for this tool to connect is not right..."

    If it was a web.config setting that would be a different story.
    SURFThru.com, Jan 29, 2009
    #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. HRsoft Informática

    Visual Web Express 2008 X Visual Studio Pro 2008

    HRsoft Informática, Jun 8, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    691
    Cowboy \(Gregory A. Beamer\)
    Jun 9, 2008
  2. Julien
    Replies:
    1
    Views:
    2,044
    Cowboy \(Gregory A. Beamer\)
    May 18, 2009
  3. Chen
    Replies:
    4
    Views:
    1,357
  4. Nathan Sokalski
    Replies:
    4
    Views:
    760
    SURFThru.com
    Jan 29, 2009
  5. Afshin
    Replies:
    7
    Views:
    329
    Afshin
    Jul 13, 2013
Loading...

Share This Page