Find a post...

DNN-Connect Blogs

Get profile properties in DNN

This SQL function will help you retrieving property values from the users.

You can even ask for custom created properties.

you can use it in your reports like this:

select userid,username

,dbo.BIT_GetPropertyValue(0,userid,'Phone') as 'Phone'

,dbo.BIT_GetPropertyValue(0,userid,'Mobile') as 'Mobile'

from users

 

 

CREATE FUNCTION [dbo].[BIT_GetPropertyValue]
(
@PortalID int, -- portalid
@UserID int, -- UserID
@Property nvarchar(100) -- name of the property to read
)
RETURNS nVarChar(4000) -- the value of the property for the user
AS
BEGIN
DECLARE @RetVal AS nVarChar(4000) = ''
select @RetVal = PropertyValue
from UserProfile
where UserID = @UserID
and PropertyDefinitionID = dbo.GetProfilePropertyDefinitionID (@PortalID,@Property)

RETURN @RetVal
END 

 

Passionate DNN.NET specialist helping customers with the automation of their organisation. Having a large technical SAP background, I connect DNN to SAP seamlessly. I'm an expert not only in connecting SAP but all kinds of different systems. It does not even need to be a known product, ff it's possible to extract data, I'll do it. DNN is the base of all my projects as it contains already the stuff you will need anyway: users, roles, pages, .. and of course the fantastic way you can develop modules for it. I especially like the install with the versioning system of the modules. It helps me so I can totally focus on the business problem of my clients. I've been making modules for DNN since my first .NET application with the I Buy Spy release.

Hosting liberally provided by

Geoff Barlow 558 4
DNN-Connect 432 6
Peter Donker 5247 31
Christopher Hammond 701 2
Olivier Jooris 424 1
Daniel Mettler 12098 88
Clint Patterson 1 1
Jos Richters 65 1
James Rosewell 336 2
Will Strohl 1553 27
Ernst Peter Tamminga 444 4
Barry Waluszko 2958 2
Declan Ward 531 1
Gifford Watkins 726 9
Torsten Weggen 2887 3