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...Using Modules a...Using Modules a...User Create And Update Status in DNNUser Create And Update Status in DNN
Previous
 
Next
New Post
8/26/2011 5:09 AM
 
hi
my project requires to create user and update user programmatically.
i am able to create and update user but my question is how to find the user is updated means user updated status.
in dnn api its showing

public static UserCreateStatus CreateUser(ref UserInfo objUser);
public static void UpdateUser(int portalId, UserInfo objUser);

so CreateUser method has return type of "UserCreateStatus" to find the user is created or not

but UpdateUser method doesnot have any return type how can i find user is successfully updated or not?
 
New Post
8/26/2011 8:05 AM
 
that appears to be an API oversight - please log an enhancement request at support.dotnetnuke.com requesting that an overload be created that returns a status indicator.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/26/2011 7:56 PM
 
Unlike the CreateUser() api call - Its technically almost impossible for an UpdateUser call to fail if a valid userinfo object is passed into it.

If the update were to fail in any way, it would be because of a serious error - and as such  - would cause a system exception.

The CreateUser() api call does a lot of different testing to before a user is created - all of which can possibly produce different UserCreateStatus values.  

In some ways - it could be considered bad coding design to surface these as a UserCreateStatus values - if you were following the asp.net exception processing guidelines - where the norm would be for each UserCreateStatus to throw an exception which would be handled by the normal try/catch processing system.

But regardless - for now if you need to test for a FAILED UpdateUser() call
 - wrap the call in a try/catch - if it fails an exception will be generated - by the low level dataprovider calls.

Wests
 
New Post
8/29/2011 4:37 AM
 
thanks for your reply

i know that dnn people work hard for dnn cms.
but while we are executing queries we have to know weather the task is success or failure with return type like create user method.
if the user update record is good its OK.
if unfortunately the record has errors means it has to give failure return type  then only we can easily find the status and move to next coding level depend on the status instead of try catch block.

that will give more comfort for developers.

thanks
rakesh
 
New Post
11/28/2016 10:55 PM
 
Hi Team,
I am getting below exception while creating user. please help its urgent.


System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at PetaPoco.Database.ExecuteScalar[T](String sql, Object[] args)
at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteScalar[T](String connectionString, CommandType type, Int32 timeout, String sql, Object[] args)
at DotNetNuke.Data.SqlDataProvider.ExecuteScalar[T](String procedureName, Object[] commandParameters)
at DotNetNuke.Data.DataProvider.AddUser(Int32 portalID, String username, String firstName, String lastName, Int32 affiliateId, Boolean isSuperUser, String email, String displayName, Boolean updatePassword, Boolean isApproved, Int32 createdByUserID)
at DotNetNuke.Security.Membership.AspNetMembershipProvider.CreateDNNUser(UserInfo& user)
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...User Create And Update Status in DNNUser Create And Update Status in DNN


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