Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Membership Management - problem reading users from SQL 2005

Reply
Thread Tools

Membership Management - problem reading users from SQL 2005

 
 
Pieter S
Guest
Posts: n/a
 
      05-23-2006
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.W eb, 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 ***
 
Reply With Quote
 
 
 
 
PeterKellner
Guest
Posts: n/a
 
      05-23-2006
On Tue, 23 May 2006 07:01:40 -0700, Pieter S <(E-Mail Removed)>
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BMC Configuration Management - Users Group, formerly Marimba Users Group. chrisandnat@gmail.com Java 0 10-01-2007 06:36 PM
Clear all tables (Membership, Profile, Users, ...) in SQL 2005 shapper ASP .Net 1 02-23-2007 08:55 PM
Can't quite get the Membership/Roles configured to work on SQL 2005 Jack ASP .Net 0 08-13-2006 09:43 AM
VS.net installs sql express as default datastore for role/membership management. Bruno ASP .Net 4 01-04-2006 04:18 PM
frustrated w/ Sql 2005 membership provider jeffp ASP .Net Security 0 07-01-2005 03:16 AM



Advertisments