Derik Whittaker

Syndication

News


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. 

image

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:

 
    [Table]
    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.

 
    [Table]
    public class EpisodeTag
    {
     
	... Fluff goes here

     	[Column]   
        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: , ,

[Advertisement]

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)