Membership Management - problem reading users from SQL 2005

Discussion in 'ASP .Net Security' started by Pieter S, May 23, 2006.

  1. Pieter S

    Pieter S Guest

    Hello,

    I've configured SQL server 2005 as my back-end data store via
    aspnet_regsql.exe. I presume it was succesvol. Creating users en roles
    programmatically is no problem. When I start the Web Site Administration
    Tool I can see the created users and roles. But when I want to show them
    by code I get an empty result.

    ...
    ... Roles.GetAllRoles()
    ...
    ... membership.GetAllUsers()

    The roleManager is enabled in web.config.

    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
    <providers>
    <clear />
    <add connectionStringName="LocalSqlServer"
    applicationName="/"
    name="AspNetSqlRoleProvider"
    type="System.Web.Security.SqlRoleProvider,System.Web, Version=2.0.0.0,
    Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    </roleManager>

    My membership provider:

    <membership defaultProvider="AspNetSqlMembershipProvider">
    <providers>
    <clear />
    <add name="AspNetSqlMembershipProvider"
    connectionStringName="LocalSqlServer" applicationName="/"
    requiresQuestionAndAnswer="true"
    type="System.Web.Security.SqlMembershipProvider,
    System.Web,Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    </membership>

    My connectionstrings:

    <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="data source=NET\NET;Initial
    Catalog=Tekstbank;User ID=adminTekstbank;Password=*****"
    providerName="System.Data.SqlClient" />
    <add name="TekstbankConnectionString" connectionString="Data
    Source=NET\NET;Initial Catalog=Tekstbank;User
    ID=adminTekstbank;Password=*****"
    providerName="System.Data.SqlClient" />
    </connectionStrings>

    Can someone give me advice about this problem?

    Friendly greetings,
    Pieter

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Pieter S, May 23, 2006
    #1
    1. Advertising

  2. Pieter S

    PeterKellner Guest

    On Tue, 23 May 2006 07:01:40 -0700, Pieter S <>
    wrote:

    >Hello,
    >
    >I've configured SQL server 2005 as my back-end data store via
    >aspnet_regsql.exe. I presume it was succesvol. Creating users en roles
    >programmatically is no problem. When I start the Web Site Administration
    >Tool I can see the created users and roles. But when I want to show them
    >by code I get an empty result.
    >
    >..
    >.. Roles.GetAllRoles()
    >..
    >.. membership.GetAllUsers()
    >
    >The roleManager is enabled in web.config.
    >


    Pieter,

    The website config program uses your web.config so if that tool works,
    so should your app. Very strange. I'd suggest downloading my
    ObjectDataSource and trying it. It completely incapsulates Membership
    and Roles (in code of course). If that works, you will see examples
    of how to call the API working.

    Good Luck,

    Here is a link to the post with the MSDN article and code:
    http://peterkellner.net/?p=24
    Peter Kellner
    http://peterkellner.net
     
    PeterKellner, May 23, 2006
    #2
    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. Alucard

    No SQL management studio in VS 2005

    Alucard, Nov 2, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    398
    Alucard
    Nov 2, 2005
  2. Bruno
    Replies:
    4
    Views:
    1,867
    Bruno
    Jan 4, 2006
  3. Jack
    Replies:
    0
    Views:
    800
  4. shapper
    Replies:
    1
    Views:
    365
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 23, 2007
  5. Replies:
    0
    Views:
    571
Loading...

Share This Page