views:

64

answers:

2
Dim usersInRole As String() = Roles.GetUsersInRole("HR_Base_Role")
Dim Myusers As New MembershipUserCollection

For Each UserName As String In usersInRole
    Myusers.Add(Membership.GetUser(UserName))
Next
ComboBox2.DataSource = Myusers

The code above throws a "Specified method is not supported." exception on the first line. Any one knows what am doing wrong here?

A: 

I'm not sure the ASP.NET Membership provider is intendend for Windows Forms applications. But it seems others have been down that path before, did you check out this question here on SO, How to implement security component in Windows Forms?

Jakob Gade
Typo corrected, but exception still being thrown.
Name.IsNullOrEmpty
A: 

Membership, Roles and Profiles are all ASP.Net technologies and require a properly configured web site.

In .NET 3.5 these facilities were extended to support use from desktop applications via Application Services, but note that a properly configured ASP.Net website is still the source of the data/services.

To properly utilize these facilities, please ensure familiarity with the linked information.

Reference: http://msdn.microsoft.com/en-us/library/bb547119(VS.90).aspx

Sky Sanders