Entity Framework result set not correct

This is a common problem that most of the people run into. You create an entity model to your view or table. Create a domain service and the client side code. In the client side code you put the filter and you run expecting to get some data but you end up getting one or few rows. I ran into the same problem yesterday. When I ran the program I got just the first row of the expected result.

The problem in my case, when I created the model from my table, I made some changes to attributes, removed bunch of columns, while doing it, i removed the unique key that identified the rows. It seems that if Entity Framework can not uniquely identify the rows, it does not return all the rows. To fix it, all I had to do is, go back to the model, make the fields that uniquely identify the rows, recompile and that’s it.

So if you run into any situation where the rows are not coming properly, this may be one of the culprit.

Technorati Tags: ,

Where is IPagedCollectionView?

This is nothing but a sticky note for me than a post. I downloaded a project and when I tried compiling the project I got an error from the compiler that it couldn’t find IPagedCollectionView. I checked the name space of the class in my other box and it pointed me to System.ComponentModel, I checked the references and I do have that dll. (One thing I did not check was to double click open the reference and see if the class definition there). Anyway, I went directly to the trusted source regarding these kind of problems, Microsoft msdn web site and found the missing dll. Even though the name space points to System.ComponentModel. the class definition is in System.Windows.Data.dll. So for future reference if you run into this problem, now you know, where it is 🙂


Full screen mode in SilverLight 4

In one our project page it was requested to show the silver light content in Full screen, with out IE headers, tool bars etc., you can achieve this by simply pressing F11. I guess it is a power option and most of the users would not know this command. One option is document it and train. I guess you all know how that one goes. I knew there was a solution to this problem since I have seen examples of silver light media playing movie clip in full screen mode. I looked around on net and found the following link. But before you go there and try out, it will not work in SL4. I am putting the link for documentation purpose of the initial approach taken in SL2.

Tips and Tricks in Silver light (Full screen in SL2 not SL4)


The concept is straight forward. If the full screen option is selected, the browser host will blow up to full screen. Something changed from SL2 and SL4. After more research on the web, found the solution in the following link and I thought I share it with you for anyone looking for full screen solution in SL4. The link is not only to identify what changed in SL4 to get full screen mode but also all the changes in SL4. This is a good reference to have, since most of the net searches bring back SL2 or 3  version of solution, refer the following to find if it changed or not. If changed what is the correct way to do it in SL4.


Full Screen Mode in SL4 and other changes to SL4

Technorati Tags: ,

Random information on Silverlight


Just want to document two things I came across yesterday.

First one is an error:

This morning one of my colleague try to check out my application and try out. They were able to compile successfully and when he ran the application, he got an error

WCF RIA services will fail unless the silverlight project is hosted in and launched from the same web project that contains the WCF RIA services

This happens when you have you silverlight application (client side) set as the startup project. All you have to do is set web as the start up project and assign the .aspx or .html as the start up page and you are all set.


Second one is tip:

I have created a simple application which consumes a model set to connect to a database. Which worked fine. Now I have to change it to a different data base to do some volume testing. That data base has same table and scheme etc., To do that for your testing purpose, simply go to web.config on the silverlight web project and change the initial catalogue. This is for ad-hoc testing but if you would need to do more frequently, then do it in the server side code based on some parameters.