how to make custom properties be saved in "FirstName" and "LastName" columns in the mp_Users table?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
3/8/2010 11:10:23 AM
Gravatar
Total Posts 192

how to make custom properties be saved in "FirstName" and "LastName" columns in the mp_Users table?

Ok, this is the problem I'm having.

I want to save First Name and Last Name of users, seperately, so I simply added them to properties to customProfile.config

the problem I'm having is the values will not be saved in mp_Users table. but they will be saved in mp_UserProperties table in name and value columns for the property.

(actually the problem I'm having is I can't sort data based on ntext column type, and propertyValueString is ntext in mp_userProperties.)

if I add a customProperty named as "Country" to customProfile.config, it will be saved in the country column of mp_users. but same is not true for firstName and LastName.

how can data be saved in those two columns of mp_users?

can it be done without changing code?

(I'm using mojoPortal 2.3.3.0)

3/8/2010 12:55:03 PM
Gravatar
Total Posts 18439

Re: how to make custom properties be saved in "FirstName" and "LastName" columns in the mp_Users table?

Hi,

I added the first name and last name fields not long ago for future purposes but have not yet surfaced them to the UI.

You cannot add custom properties as fields in the mp_Users table nor should you modify any existing tables.

The reason some custom profile properties do map to those columns is because those fields were added early in the project before we added the userproperties table.

I'm not sure of a good solution for you about sorting from ntext fields. in theory you could try using our SqlAzure data layer with MS SQL 2005 or 2008 and it should work but then you would always have to remember to upgrade using the SqlAzure packages. The reason I mention it is because in SqlAzure there is no ntext data type so we have to use nvarchar(max). I'm not sure if nvarchar(max) has the same sorting issue that ntext has, it might not.

However in mojoPortal code we are not sorting anything on those custom properties, we load them as a DataTable inside SiteUser but we cannot sort users by these properties with any efficiency regardless of data type.

If you need different functionality you might consider creating your own table to store your additional user properties and create your own business class to expose them, sort them search on them or whatever.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.