Take the 2-minute tour ×

lately I have been messing around with the Silverlight Business Application template to get me used to silverlight / wcf ria services. I have encountered a wierd issue that I don't know how to solve.

So far all I've done was created a new profile property called "AvatarURL", the basic concept is from this Avatar tutorial, and removed the FriendlyName property. The difference is that I'm just setting the AvatarURL property to default (~/Images/Default.jpg) when the user registers instead of writing a byte array to file. So I'm not browsing for files or pulling from webcam or anything like that during the registration phase.

I've made the necessary changes to LoginStatus.xaml etc, and after logging in the image wouldn't display in it's placeholder. I stepped through the 'Authentication_LoggedIn' eventhandler in LoginStatus.xaml and for some reason the user's AvatarURL property is only a partial value. If the value in the database is: "http://localhost:52878/Images/Default.jpg". The value I get when I do the stepthrough is: "http://localhost:528".

I have double checked the database values and ensured they are correct. If I input the XAML Image's Source value manually (http://localhost:52878/Images/Default.jpg) it displays the image no problem. It appears to be a problem between the communication between the silverlight app and the asp.net website project. Due to the fact I've only made miniscule changes to the solution, and written none of the code that wires the 2 projects together, I have no idea where to look to solve this problem, anyone have any ideas?

I can post some code if necessary but it's not much different than the default business template.

Thanks in advance.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

As the saved entry (http://localhost:528) is exactly 20 characters long and a common default length for text values in databases is 20 characters, I am guessing the size limit is actually in your database table and the values entered are being truncated.

Please check the database schema and let me know of that is not the case.

share|improve this answer
The column for the profile property is generated by the aspnet_regsql.exe application. It says the datatype is ntext and the 'size' which is uneditable says 6000. Also when I use the solution explorer to view the table data, the entire URL is present in the column –  SilverX Sep 24 '11 at 19:12
Oh looking at the value in the PropertyNames column. It says AvatarURL:S:0:20, which at first glance seems to define the length. If so.. do you know how to change it? –  SilverX Sep 24 '11 at 19:20
Oddly enough. I was using the Uri class to build the URL then using uri.AbsoluteUri to obtain the URL string and passing that to the profile provider. Even though the correct value was being inserted into the database it was not recording the proper length. I have since switched to using an actual string, and it appears to be working just fine... wierd. –  SilverX Sep 24 '11 at 19:52
add comment

Your Answer


