asp.net 2.0 membership conundrum

Discussion in 'ASP.NET 2.0' started by jgs3, Jan 24, 2008.

  1. OK, I admit it - I am not the brightest light in the string. It took me what feels like forever to get my mind around membership. Got that working great on my site.

    What I can't do is convince the ASP.NET Web Administration Tool to look at my database for users and roles. It tells me there are no users configured but I know that's not true. My /web.config on the local machine:




    <configuration>


    <connectionStrings>


    <remove name="LocalSqlServer" />


    <add name="LocalSqlServer" connectionString="Data Source=mssql##.discountasp.net;Initial Catalog=DB_#####;User ID=#######;Password=####"


    providerName="System.Data.SqlClient" />


    </connectionStrings>


    <system.web>


    <roleManager enabled="true" />


    <authentication mode="Forms" >


    <forms loginUrl="/auction/login.aspx" name=".ASPNETAUTH" timeout="60" />


    </authentication>


    <membership>


    <providers>


    <clear/>


    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=##########" connectionStringName="LocalSqlServer" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5"/>


    </providers>


    </membership>


    </system.web>


    </configuration>


    So I figure the Web Admin tool is not looking at my database and looking somewhere else.


    Where do I start looking?


    Jim
     
  2. Thanks folks for the replies.


    Vikram - I would hope that the connection string that gets me to the database for everything else would be sufficient for membership, but I have been way wrong on assumptions before. [​IMG]


    Wisemx - the only difference I see in the config is the "tcp:sql.discountasp.net" versus "mssql###.discountasp.net". Is that a 2005 difference over 2000?


    To answer your question, the wizard for the control set it up that way.


    Thanks for the links to the information. I am going to dive right in and see what I can find.


    Thanks again both of you for your time and efforts.


    Jim
     
  3. I'm pretty sure I used the TCP with SQL 2000 here too.
    Yes your connection string is almost the same but notice the Clear, Remove then Add, it adds insurance.
    For our weary souls. [​IMG]
     
  4. Will give those details a try. Couldn't hurt could it... [​IMG]
     
  5. Your web.config looks fine. ASP.NET Web Administration Tool uses the connection string in your web.config to access exiting roles and users.make sure its contains the appropriate database information.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  6. Your connection string should look more like this:

    <connectionStrings>
    <clear/>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL2005_db;User ID=SQL2005_user;Password=*******;" providerName="System.Data.SqlClient"/>
    </connectionStrings>

    And in your providers...Why are you setting requiresQuestionAndAnswer="true" ?

    Here are a few resources:
    http://asp.net/learn/videos/video-45.aspx
    http://asp.net/learn/videos/video-47.aspx
    http://asp.net/learn/videos/video-148.aspx
     

Share This Page