Доброго времени суток! Подскажите как решить проблему: есть БД scoreDB, в ней таблица ScoreTable со свойствами Name (string) и Score (int). Хочу отобразить Score, упорядочив по возрастанию: t = from ScoreTable s in scoreDB.ScoreTable orderby s.Score descending select s;
На строке: GameScoreCollection = new ObservableCollection<ScoreTable>(t);
Компилятор возвращает: «The member 'BrainGainWP.ScoreTable.Score' has no supported translation to SQL.» (GameScoreCollection коллекция, к которой привязываю textBlock)
Если упорядочить по Name все работает: t = from ScoreTable s in scoreDB.ScoreTable orderby s.Name descending select s;
код таблицы: [Table] public class ScoreTable : INotifyPropertyChanged, INotifyPropertyChanging {
[Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
private int _Score;
public int Score
{
get
{
return _Score;
}
set
{
if (_Score!= value)
{
NotifyPropertyChanging("Score");
_Score= value;
NotifyPropertyChanged("Score");
}
}
}
private string _Name;
[Column]
public string Name
{
get
{
return _Name;
}
set
{
if (_Name != value)
{
NotifyPropertyChanging("Name");
_Name = value;
NotifyPropertyChanged("Name");
}
}
}