locked
The property 'LastActivityDate' is not supported by the Active Directory membership provider RRS feed

  • Question

  • User-2036591223 posted

    Hi,

    I am trying to get all users from the Active Directory and should be displaying on the GridView that was binded to ObjectDataSource that targets System.Web.Security.Membership.GetAllUsers(). I am getting the following error

    The property 'LastActivityDate' is not supported by the Active Directory membership provider

    How can I handle this exception in my project..

    Thanks.

    Ravi.

     

    Thursday, April 6, 2006 5:36 PM

All replies

  • User-2036591223 posted

    Infact I found the way of solving this... I did something like

    -- Business Layer

    Public Class ActiveDirectoryMember

    Public Sub New(ByVal EMail As String, ByVal UserName As String, ByVal CanAuthenticate As Boolean, ByVal CreatedDate As Date)

    _Email = EMail

    _UserName = UserName

    _CanAuthenticate = CanAuthenticate

    _CreationDate = CreatedDate

    End Sub

    Public Shared Function GetAllUsers() As List(Of ActiveDirectoryMember)

    Return DataAccessLayer.ActiveDirectoryData.GetAllUsers()

    End Function

     

    -- Data Layer

    Public Class ActiveDirectoryData

    Public Shared Function GetAllUsers() As List(Of ActiveDirectoryMember)

    Dim list As New List(Of ActiveDirectoryMember)()

    For Each membershipUser As MembershipUser In System.Web.Security.Membership.GetAllUsers()

    Dim User As ActiveDirectoryMember = New ActiveDirectoryMember(membershipUser.Email, membershipUser.UserName, membershipUser.IsApproved, membershipUser.CreationDate)

    list.Add(User)

    Next membershipUser

    Return list

    End Function

    End Class

    Thursday, April 6, 2006 9:31 PM