This project is read-only.

Error when searching Biography field... if users have lots of information in their bios


Fix: Do not search all profile properties.
Error: User Directory is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Data is Null. This method or property cannot be called on Null values. ---> System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values. at System.Data.SqlClient.SqlBuffer.get_String() at System.Data.SqlClient.SqlDataReader.GetString(Int32 i) at effority.UserDirectory.Controller.GetUserProfileDic(List`1 ProfileDefinitions, Int32 PortalId) at effority.UserDirectory.View.GetUserTable(Boolean FromCache) at effority.UserDirectory.View.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---


benc123 wrote Sep 4, 2012 at 3:41 PM

Anyone solved this issue? I'm still getting the error - its not allowing me to display the module at all let alone search on the bio field. I've removed the bio field from the search list in settings which hasn't helped. Any advice much appreciated. Using Dotnetnuke 5.4.2, user directory 1.1.9

wrote Feb 14, 2013 at 3:19 AM

mryckman wrote Jul 9, 2014 at 12:23 AM


This is still an issue - but not for a good reason. The module gathers the profile properties by going directly to the UserProfile table. You can see that in the code for GetUserProfileDic here:

That table has two fields - a "Value" field and a "Text" field. The value field is used for most stuff, and the text field is used when values are too long. So, DNN has a view - vw_Profile - that automatically handles this. If the code were updated to point to the view instead of the table, then it would work. If they do that, they'd also have to change the built out where statement (which, on a side note, seems messy), to use the field names instead of their IDs.

Alternatively, they could change the SQL statement to do what DNN's view does and have this line:

CASE WHEN PropertyText IS NULL THEN PropertyValue ELSE PropertyText END as PropertyValue

I think that would also correct the error.


wrote Jul 9, 2014 at 12:24 AM