I'm in the middle of moving to DNN4.3.5 and have found that with the changes to the User Profile tables I've broken a link to another webapp that uses the user database from DNN. Under DNN3.2, I used the following SQL View (written by someone on the ASP.NET forum) to pull all the user profile data into a single View. Now that I'm moving to 4.3.5 the user information is in a different format in the UserProfile table. I was wondering if someone could get me started again with a msSQL View for DNN4.3.5 to pull the same information into a single table?
Thanks for the help....
Here is the SQL View I used with DNN3.2
CREATE VIEW dbo.vw_View_UserProfiles AS SELECT dbo.aspnet_Profile.UserId, dbo.aspnet_Users.UserName, dbo.aspnet_Users.LoweredUserName, dbo.aspnet_Membership.Password, dbo.aspnet_Membership.Email, dbo.aspnet_Membership.LoweredEmail,
dbo.GetProfileElement('FirstName', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS FirstName,
dbo.GetProfileElement('LastName', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS LastName,
((dbo.GetProfileElement('FirstName', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString)) + ' ' + (dbo.GetProfileElement('LastName', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString))) AS FullName,
dbo.GetProfileElement('Street', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS Street,
dbo.GetProfileElement('City', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS City,
dbo.GetProfileElement('PostalCode', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS PostalCode,
dbo.GetProfileElement('Country', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS Country,
dbo.GetProfileElement('Phone', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS Phone,
dbo.GetProfileElement('Fax', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS Fax,
dbo.GetProfileElement('Cell', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS Cell,
dbo.GetProfileElement('TimeZone', dbo.aspnet_Profile.PropertyNames, dbo.aspnet_Profile.PropertyValuesString) AS TimeZone
FROM dbo.aspnet_Profile INNER JOIN dbo.aspnet_Users ON dbo.aspnet_Profile.UserId = dbo.aspnet_Users.UserId INNER JOIN dbo.aspnet_Membership ON dbo.aspnet_Users.UserId = dbo.aspnet_Membership.UserId
WHERE dbo.aspnet_Membership.PasswordFormat = 0 AND dbo.aspnet_Membership.IsApproved = 1 AND dbo.aspnet_Membership.IsLockedOut = 0
|