2009-11-01 35 views
0

以下RIA代码适用于我的silverlight客户端。但我不想要表中的所有数据“tbLeagues” - 那么我将如何过滤它?Silverlight客户端 - 简单的RIA select where子句

  JasonsDomainContext context = new JasonsDomainContext(); 
     dgLeagues.ItemsSource = context.tbLeagues; 
     context.Load(context.GetTbLeagueQuery()); 

读了许多文章在那里的常态,似乎要做到这一点....(带where子句中),但即使这是正常的选择让我在我的DataGrid中没有记录。

JasonsDomainContext context = new JasonsDomainContext(); 
     dgLeagues.ItemsSource = from l in context.tbLeagues 
           select l.dbLeagueName; 

     context.Load(context.GetTbLeagueQuery()); 
  1. 我在做什么错?
  2. 这是最好的方法吗?

感谢, 杰森

回答

0

你有没有尝试添加where子句中的JasonsDomainServices GetTbLeague方法?

+0

非常感谢 - 你会相信它 - 我试了一下你周围建议第一次,它将让我把在LINQ语法不 重新启动,当我试图再次(如你所说)VS提示我。为“使用System.Windos.Ria.Data;”被添加。 而我开始工作。 using System.Windows.Ria.Data; dgLeagues.ItemsSource = context.tbLeagues; context.Load( from context.GetTbLeagueQuery() where t.dbLeagueName.Contains(“22”) select t ); 谢谢,J – 2009-11-01 16:34:11