I am using Altairis security providers for a memebership and roles in my asp.net web application. For registration I use CreateUserWizard. And after the user is created I want to insert his username into another table called Profiles.
HTML
------------
<asp:CreateUserWizard ID="CreateUserWizard1" OnCreatedUser="CreateUserWizard1_CreatedUser" ....... />
VB
------------
Protected Sub CreateUserWizard1_CreatedUser(sender As Object, e As EventArgs)
'Create profile
Dim connStr As String = System.Configuration.ConfigurationManager.ConnectionStrings("DeskriptivaConnectionString").ConnectionString.ToString()
Using conn As New SqlConnection(connStr)
Try
Dim cmd As SqlCommand = conn.CreateCommand()
cmd.CommandText = "INSERT INTO Profiles (UserName) VALUES (@UserName)"
cmd.Parameters.Add("@UserName", System.Data.SqlDbType.NVarChar).Value = CreateUserWizard1.UserName
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Using
End Sub
But when the registration is complete the username doesnt insert into the Profiles table and no error message display. What should I do to make it working?