Createuser exception handling

J

John

Hi

I am using the membership createuser method but need to find the error when
one arise. I am using the below code;

Public Function CreateUser(ByVal Username As String, ByVal Password As
String, ByVal Email As String, ByRef ErrMsg As String) As Boolean
Try
Membership.CreateUser(Username, Password, Email)
CreateUser = True
Catch ex As MembershipCreateUserException
ErrMsg = ex.StatusCode
CreateUser = False
End Try
End Function

The problem is that as far as I can tell the ErrMsg always returns blank.
What am I doing wrong?

Thanks

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top