The code snippet provided below works. I am trying to build a report from the typical ASP .NET user profile definitions and I don't know how to go about it.
In the code below I have defined INNER JOIN UserProfile UP on U.Userid = UP.UserID
In this table there is a field to define as UP.PropertyDEfinitionID
Now depending on the value of this field example:
35 = Company Name
31 = Phone
33 = Fax
... and so on.
THEN I want to add a column name corresponding to the PropertyDEfinitionID value (eg Company) and set the column value to the next field called PropertyValue
So I would assume that the definition of PropertyValue would be UP.PropertyValue
The outcome of my report would be:
AND THEN ...
AND SO ON ......
Urgent help required ...
SELECT U.Username, U.Firstname, U.Lastname, R.Rolename, AM.Email
FROM Users U
INNER JOIN UserRoles UR on U.Userid = UR.Userid
INNER JOIN Roles R on UR.Roleid = R.Roleid
INNER JOIN Aspnet_users AU on U.Username = AU.Username
INNER JOIN Aspnet_membership AM on AU.Userid = AM.Userid
INNER JOIN UserProfile UP on U.Userid = UP.UserID