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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Some assistance on adding multiple users through SQL or DNN MethodsSome assistance on adding multiple users through SQL or DNN Methods
Previous
 
Next
New Post
10/5/2008 12:25 PM
 

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
======================================================
 
New Post
10/6/2008 11:19 AM
 

Personally there are many free or moderatly priced tools that will do this for you, that I would almost recommend just looking at them.  DataSprings.com has a great tool for this purpose.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
1/24/2009 1:38 PM
 

Thanks for the reply,

 

I solved this issue myself, i wrote a few SQL scripts that targeted the correct tables in the DNN Database, I studied the database, tables , sp's , views and then it was just a matter of walking through the process of inserting the page data into the tabs table, setting the permisssions, then a script to add the correct modules and then set its properties and.

Everything worked out well , when i really analysed the database of the framework and the tables related to the 3rd party modules it was just a matter of writing the SQL script to insert the data i needed, its really powerful way of working with the framework, now that im working with 100's of users and the 1000's of pages manging the process of adding modules and data , content etc to the whole site is just a matter of running a sql script.

 

Im now integrating those SQL scripts into a Desktop application that interfaces with my remote site.  So when i want to run a poll for every politician its a matter of loading the interface, adding the parameters and executing the script. 

 
New Post
1/25/2009 7:39 PM
 

DNNMasters has a nice module for user import, and though I don't use it often, I've used it over a period of years. Sounds like they have a solid re-vamping in the works.

But I have a rare situation where I need to do some manual import. Would you mind sharing the SQL statement you used for import so I can modify and review for use? If so pmgerholdt AT hotmail.com ... and thanks.


pmgerholdt
 
New Post
1/25/2009 8:42 PM
 

Patrick Lismore wrote

What I am trying to do is  call a stored procedure or method that will create a new user. 

I've used John Mitchell's Import User script is, and it's awesome! I just used it export my users from DNN2 and import them into DNN5. This was the SQL I wrote to export my userbase...

SELECT
'<User><Username>' + u.Username + '</Username>',
'<Email>' + u.Email + '</Email>',
'<FirstName>' + u.FirstName + '</FirstName>',
'<LastName>' + u.LastName + '</LastName>',
'<Password>' + u.Password + '</Password>',
'<Unit>' + u.Unit + '</Unit>',
'<Street>' + u.Street + '</Street>',
'<City>' + u.City + '</City>',
'<Region>' + REPLACE(u.Region,'<Not Specified>','') + '</Region>',
'<PostalCode>' + u.PostalCode + '</PostalCode>',
'<Country>' + u.Country + '</Country>',
'<Telephone>' + u.Telephone + '</Telephone></User>'

FROM UserPortals up INNER JOIN Users u ON u.UserID = up.UserId WHERE up.PortalId = 5

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Some assistance on adding multiple users through SQL or DNN MethodsSome assistance on adding multiple users through SQL or DNN Methods


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