In the following code I am recieving these errors. I am atemmpting to do the impossible as it seems now and that is gather additiaonal user data while creating a new user utilizing the CreateUserWizard control. I was able to locate the following code and I think my process will work if I can correct these errors. I have place arrows where I have the bad syntax or code. Can anyone tell me how or what I should change the code to. Please provide the full code or syntax if you can help. Thanks in advance.
1. 'ProviderUserKey' is not a member of 'System.Web.Security.Membership'
2. 'System.Web.Security.MembershipUser' cannot be converted to 'System.Web.Security.Membership'
Partial Class registration
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As EventArgs) Handles CreateUserWizard1.CreatedUser
' Get the UserId of the just-added user
----> Dim newUser As Membership = Membership.GetUser(CreateUserWizard1.UserName)
----> Dim newUserId As Guid = DirectCast(newUser.ProviderUserKey, Guid)
'Get Profile Data Entered by user in CUW control
Dim FirstName As String = DirectCast(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("FirstName"), TextBox).Text
Dim LastName As String = DirectCast(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("LastName"), TextBox).Text
' Insert a new record into User_Profile
' Get your Connection String from the web.config. MembershipConnectionString is the name I have in my web.config
Dim connectionString As String = ConfigurationManager.ConnectionStrings("MembershipConnectionString").ConnectionString
Dim insertSql As String = "INSERT INTO User_Profile(UserId,FirstName, LastName) VALUES(@UserId, @FirstName, @LastName)"
Using myConnection As New Data.SqlClient.SqlConnection(connectionString)
Dim myCommand As New Data.SqlClient.SqlCommand(insertSql, myConnection)