Blog
DNN Profile Value Lookup
CREATE FUNCTION GIBS_GetProfileElement ( @userID as int, @portalID as int, @ProfilePropertyName as nvarchar(100) ) RETURNS nvarchar(4000) AS BEGIN -- If input is invalid, return null. IF @ProfilePropertyName IS NULL OR LEN(@ProfilePropertyName) = 0 OR @userID IS NULL OR @userID < 1 RETURN NULL DECLARE @PropertyValue AS NVARCHAR(400) SET @PropertyValue = ( SELECT UserProfile.PropertyValue FROM (Users INNER JOIN UserProfile ON Users.UserID = UserProfile.UserID) INNER JOIN ProfilePropertyDefinition ON UserProfile.PropertyDefinitionID = ProfilePropertyDefinition.PropertyDefinitionID WHERE (((Users.UserID)=@userID) AND ((ProfilePropertyDefinition.PropertyName)=@ProfilePropertyName) AND ProfilePropertyDefinition.PortalID = @portalID) ) RETURN @PropertyValue END
120 OLD FREEMANS WAY, BREWSTER, MA 02631
MAILING: P.O. BOX 2342, BREWSTER, MA 02631