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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.04.9.1 Adding "core" fields to user table4.9.1 Adding "core" fields to user table
Previous
 
Next
New Post
1/30/2009 4:19 AM
 

hi,

im currently mauling a dotnetnuke installation to insert a field into the Users table of the dotnetnuke database.
i have added <dnn:textcolumn datafield="Install_ID" headertext="Install ID"/> to the admin/users.ascx but it gives me an error that the property is not defined.

i would like to know where i can define this property and include it into the datagrid, editable.

Greetz

Ronald

 
New Post
1/30/2009 11:11 AM
 

Does it not work for you to add this as a custom profile property?  This is the recommended mechanism for adding fields to users.  "Mauling" the DNN tables will only cause you more problems down the road.

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
2/2/2009 2:56 AM
 

not really since the fields are dynamically generated and given an ID i cant check the field against a database value because of that. i already hardcoded another textbox in with a fixed ID and got it to check its value in a database but i dont know how to let it write its value in the DNN Users table or read from it when the user managment page is called.

 
New Post
2/2/2009 9:35 AM
 

Ronald wrote

not really since the fields are dynamically generated and given an ID i cant check the field against a database value because of that. i already hardcoded another textbox in with a fixed ID and got it to check its value in a database but i dont know how to let it write its value in the DNN Users table or read from it when the user managment page is called.

Whoa!  Take a step back here.  Just because the generated ID is dynamic doesn't mean you can't or shouldn't use the custom profile properties table.  Take this example:

SELECT PropertyDefinitionId from ProfilePropertyDefinition where PropertyName = 'MyPropertyName' and PortalID = 0

This will get you the PropertyDefinitionId for you for a custom property.  Now lets take it a step further... perhaps you want to grab user information where they have a certain value for a certain property.  Try this (this is dynamically generated SQL I pulled from a module I wrote at work... it has a lot of junk in there but illustrates my point perfectly):

SELECT Users.UserID, Users.Username, Users.FirstName, 
Users.LastName, Users.IsSuperUser, Users.AffiliateId, 
Users.Email, Users.DisplayName, Users.UpdatePassword, 
UserPortals.PortalId, UserPortals.Authorised FROM Users 
LEFT OUTER JOIN UserPortals ON Users.UserID = UserPortals.UserId 
LEFT OUTER JOIN UserProfile AS UserProfile_Responsibilities 
ON Users.UserID = UserProfile_Responsibilities.UserID AND 
UserProfile_Responsibilities.PropertyDefinitionID = 
(SELECT PropertyDefinitionId from ProfilePropertyDefinition 
where PropertyName = 'Responsibilities' and PortalID = 0) 
LEFT OUTER JOIN UserProfile AS UserProfile_Other_Language 
ON Users.UserID = UserProfile_Other_Language.UserID 
AND UserProfile_Other_Language.PropertyDefinitionID = (SELECT 
PropertyDefinitionId from ProfilePropertyDefinition 
where PropertyName = 'Other_Language' and PortalID = 0) LEFT OUTER JOIN 
UserProfile AS UserProfile_Position ON 
Users.UserID = UserProfile_Position.UserID AND 
UserProfile_Position.PropertyDefinitionID = 
(SELECT PropertyDefinitionId from ProfilePropertyDefinition 
where PropertyName = 'Position' and PortalID = 0) 
LEFT OUTER JOIN UserProfile AS UserProfile_Position_Long ON 
Users.UserID = UserProfile_Position_Long.UserID AND 
UserProfile_Position_Long.PropertyDefinitionID = (SELECT 
PropertyDefinitionId from ProfilePropertyDefinition where 
PropertyName = 'Position_Long' and PortalID = 0) WHERE 
UserPortals.PortalId = @portalId1 AND UserPortals.Authorised = 
@approved1 AND (UserProfile_Responsibilities.PropertyValue 
LIKE @searchTerm1  OR UserProfile_Other_Language.PropertyValue 
LIKE @searchTerm1  OR UserProfile_Position.PropertyValue LIKE 
@searchTerm1  OR UserProfile_Position_Long.PropertyValue 
LIKE @searchTerm1) 

So one thing to note is that I'm using parameterized queries and, as mentioned, this is dynamic SQL so I built my filter "on the fly" based on user criteria entered in a search.

There is no reason not to use the custom profile fields section... it is quite useful and you don't have to worry about breaking upgradeability.

If you want information about how to write to those profile fields in your own code just post up and ask and besides myself several other developers can help steer you in the right direction there.


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
2/2/2009 10:00 AM
 

hmmm, so i could use a few queries to get what i need... however im sadly not that experienced in SQL (or ASP.NET for that matter)

however it would take a few different queries,

1 to validate the ID from another db (remote)
1 to grab the propertyfield name
1 at login to validate the stored ID against another db again

can anyone steer me a bit to where i must be looking and what to do?

im not sure how DNN uses queries so i made my own connection as well and used the whole variable package to get the result i wanted

i apologise if my previous post sounded a bit bloaty

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.04.9.1 Adding "core" fields to user table4.9.1 Adding "core" fields to user table


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