Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Importing UsersImporting Users
Previous
 
Next
New Post
1/2/2007 4:34 PM
 

Sorry I didn't see the previous post earlier.

For this last issue, try setting the FirstName & LastName property of the Profile property also.

.Profile.FirstName = Me.tbFirstName.Text
.Profile.LastName = Me.tbLastName.Text

[edit: changed to show Profile property ]


DotNetNuke Modules from Snapsis.com
 
New Post
1/2/2007 4:40 PM
 

okay still having a problem - now everything in the admin/users page seems okay - but not any of the profile properties are set and I need to set a profile property after the user is created (and another step is finished )

but I dont see that any profile info is ever created by this routine - here is my updated code - based on your import page/module

If Page.IsValid Then
                Dim myUserInfo As Users.UserInfo = New Users.UserInfo
                With myUserInfo
                    'Membership
                    .Membership.Username = Me.tbUserName.Text
                    .Membership.Email = Me.tbEmailAddress.Text
                    .Membership.Approved = True
                    .Membership.Password = Me.tbPassword.Text
                    'Profile
                    .Profile.FirstName = Me.tbFirstName.Text
                    .Profile.LastName = Me.tbLastName.Text
                    .Profile.Unit = Null.NullString
                    .Profile.Street = Null.NullString
                    .Profile.City = Null.NullString
                    .Profile.Region = Null.NullString
                    .Profile.PostalCode = Null.NullString
                    .Profile.Country = Null.NullString
                    .Profile.Telephone = Null.NullString
                    'DNN
                    .PortalID = PortalId
                    .Username = Me.tbUserName.Text
                    .FirstName = Me.tbFirstName.Text
                    .LastName = Me.tbLastName.Text
                    .Email = Me.tbEmailAddress.Text
                    .AffiliateID = Null.NullInteger
                    .DisplayName = Me.tbFirstName.Text.Trim & " " & Me.tbLastName.Text.Trim
                End With
                Dim CreateStatus As UserCreateStatus = Users.UserController.CreateUser(myUserInfo)
                'Here we check the user status of the user we created or tried to create
                'if there is a problem we pull up a message and keep the page up so they
                'can change it - possibility of marking the field wrong exists maybe
                Select Case CreateStatus
                    Case UserCreateStatus.Success ' no problems - continue
                        Me.pnlStart.Visible = False
                        Me.pnlCompany.Visible = True
                        Me.tbUserID.Text = myUserInfo.UserID
                    Case UserCreateStatus.DuplicateEmail
                        'error code
                    Case UserCreateStatus.DuplicateUserName
                        'error code
                    Case UserCreateStatus.InvalidEmail
                        'error code
                    Case UserCreateStatus.InvalidPassword
                        'error code
                    Case UserCreateStatus.InvalidUserName
                        'error code
                    Case UserCreateStatus.UnexpectedError
                        'error code
                    Case UserCreateStatus.UserAlreadyRegistered
                        'error code
                    Case UserCreateStatus.UsernameAlreadyExists
                        'error code
                    Case UserCreateStatus.UserRejected
                        'error code
                    Case Else
                       
                End Select
            End If

 after the user is created I try to grab them and add to the profile like this 

Dim myUser As Users.UserInfo = New Users.UserInfo
                    myUser = Users.UserController.GetUser(PortalId, CType(Me.tbUserID.Text, Integer), True)
                    myUser.Profile.SetProfileProperty("CompanyID", SuccessBool.ToString)


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
1/2/2007 5:00 PM
 

Yeah updated as you said but still not any luck on the profile - users created through the regular registration are fine - not ones created thorough this process

ultimatly I will be using this to import users and need to assign these profile properties based on who is importing them- if that makes any sense

 

Might have to go to table outside that maps user to the elements I want - might make it easier to query in the long run - Would like to keep it inside the membership/profile provider to keep it clean


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
11/7/2007 8:55 PM
 

Hi Dylan,

I didn't see you got answer for your question so far, But dnnvillage released a import export module which is help you to import users in xml format so all you need is convert your table structure to valid xml file then use the module to import them to the portal. This is the address of the module( it is free). Hope it works for you.

http://www.dnnvillage.com/Projects/ImportExportUsermodule/tabid/56/Default.aspx

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Importing UsersImporting Users


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out