I have created this usersdetails.
vb file that has properties for every field that my stored proc is retuning.
Public Sub New(ByVal AspNetUserID As Guid, ByVal UserName As String, ByVal FirstName As String, ByVal MiddleName As String, _
ByVal LastName As String, ByVal Phone1 As String, _
ByVal Phone2 As String, ByVal Customer As Int32, ByVal IsAnonymous As Boolean, ByVal LastActivityDate As DateTime, _
ByVal Email As String, ByVal IsApproved As Boolean, ByVal IsLockedOut As Boolean, _
ByVal CreatedDate As DateTime, ByVal LastLoginDate As DateTime, ByVal LastLockoutDate As DateTime, _
ByVal FailedPasswordAttemptCount As Int32, _
ByVal FailedPasswordAnswerAttemptCount As Int32)
Me.AspNetUserID = AspNetUserID 'guid
Me.UserName = UserName
Me.FirstName = FirstName
Me.MiddleName = MiddleName
Me.LastName = LastName
Me.Phone1 = Phone1
Me.Phone2 = Phone2
Me.Customer = Customer
Me.IsAnonymous = IsAnonymous
Me.LastActivityDate = LastActivityDate
Me.Email = Email
Me.IsApproved = IsApproved
Me.IsLockedOut = IsLockedOut
Me.CreatedDate = CreatedDate
Me.LastLoginDate = LastLoginDate
Me.LastLockoutDate = LastLockoutDate
Me.FailedPasswordAttemptCount = FailedPasswordAttemptCount
Me.FailedPasswordAnswerAttemptCount = FailedPasswordAnswerAttemptCount
End Sub
But in my provider when I get too the function for reading the data
I get an System.IndexOutOfRangeException.
Protected Overridable Function GetUserFromReader( _
ByVal reader As IDataReader) _
As UsersDetails
'ASPNETUserID is a guid
Return New UsersDetails( _
reader("ASPNETUserID"), _
reader("UserName").ToString(), _
reader("FirstName").ToString(), _
reader("MiddleName").ToString(), _
reader("LastName").ToString(), _
reader("Phone1").ToString(), _
reader("Phone2").ToString(), _
CInt(reader("Customer")), _
CBool(reader("IsAnonymous")), _
CDate(reader("LastActivityDate")), _
reader("Email").ToString(), _
CBool(reader("IsApproved")), _
CBool(reader("IsLockedOut")), _
CDate(reader("CreatedDate")), _
CDate(reader("LastLoginDate")), _
CDate(reader("LastLockoutDate")), _
CInt(reader("FailedPasswordAttemptCount")), _
CInt(reader("FailedPasswordAnswerAttemptCount")))
End Function
I have gone through all the functions that deal with getting and reading the infor from the stored proc, and I am not missing any fields.
Does anyone know why I might be getting this exception?
Thanks,