What I am trying to do is call a stored procedure or method that will create a new user.
What I am planning to do is use this stored procedure in a SQL script to create a bulk import of users data into a local Database table, then drop that to a query window and create that new table in my remote database my site database.
the idea is to load up a table which is created from a .CSV , drop that and move it to my remote DNN site database. Then do an inset or call the relevant stored procedure to extract the new user values from the table i just created and create a user for every record.
ending up with a result of 100's of registered members on my site.
Some questions, should i just do an insert or should i use a procedure , I know that when i look at the users tables their is a password salt so I am a bit unclear as to which method to use.
I know there is a method in the source code shown below. However it has a parameter called 'objUser'
I dont know how this corresponds to the details a user enteres in when registering.
It would be great if someone could discuss this with me so I can get some clarity.
==================================================================
''' -----------------------------------------------------------------------------
''' <summary>
''' Creates a new User in the Data Store
''' </summary>
''' <remarks></remarks>
''' <param name="objUser">The userInfo object to persist to the Database</param>
''' <returns>The Created status ot the User</returns>
''' <history>
''' [cnurse] 12/13/2005 Created
''' </history>
''' -----------------------------------------------------------------------------
Public Shared Function CreateUser(ByRef objUser As UserInfo) As UserCreateStatus
Dim createStatus As UserCreateStatus = UserCreateStatus.AddUser
'Create the User
createStatus = memberProvider.CreateUser(objUser)
If createStatus = UserCreateStatus.Success Then
DataCache.ClearPortalCache(objUser.PortalID, False)
If Not objUser.IsSuperUser Then
Dim objRoles As New RoleController
Dim objRole As RoleInfo
' autoassign user to portal roles
Dim arrRoles As ArrayList = objRoles.GetPortalRoles(objUser.PortalID)
Dim i As Integer
For i = 0 To arrRoles.Count - 1
objRole = CType(arrRoles(i), RoleInfo)
If objRole.AutoAssignment = True Then
objRoles.AddUserRole(objUser.PortalID, objUser.UserID, objRole.RoleID, Null.NullDate, Null.NullDate)
End If
Next
End If
End If
Return createStatus
End Function
======================================================