I have set up the ASP.NET Membership system using MS SQL. I have also created a new table (Table2) in which the user can store additional information. The UserId column is present in both tables (Table2's UserId column is the foreign key to the UserId column in aspnet_Membership). When a new user creates their account, what is the best way to also automatically insert that user's unique UserId into a new Table2 record at the same time (obviously in the column UserId)?
Below is my attempt to do this. Not sure this is right, but I used the oncreateduser property of CreateUserWizard and called the method below -- not sure if it would work (but regardless, I'm getting the error message at bottom of this post). Please help.
Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs)
Using conn As New SqlConnection(ConfigurationManager.ConnectionStrings("MyDatabaseConnectionString").ToString())
' Create a command object.
Dim cmd As New SqlCom
View Complete Post