Derik Whittaker



NotSupportedException w/ Sql CE on WP7 Mango

As I am learning how to use SQL Ce which is available inside of WP7 mango I came across the following exception. 


This exception came from the following Linq statement

var episodesWithTags = ( from e in dimecastsDataContext.Episodes
	where e.EpisodeTags.Count( x => x.TagName == "Something 3") > 0
        select e ).ToList();

The above statement is straight forward enough and of course the TagName property is part of EpisodeTag so I was thrown for a loop.  As I am still learning this I bounced over to the EpsideTag definition you see below:

    public class EpisodeTag
	... Fluff goes here
        public string TagName { get; set; }

As you can see the TagName property is there, but it is missing one little thing, the [Column] attribute. As soon as I added the missing attribute as you see below everything worked just fine.

    public class EpisodeTag
	... Fluff goes here

        public string TagName { get; set; }

So if you ever run into this error, and you will make double, triple sure that you have added the [Column] attribute to the property in question.

Till next time,

Posted 07-20-2011 6:40 PM by Derik Whittaker
Filed under: , ,


About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)