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:
[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