views:

297

answers:

1

Hi

The following code for RIA works in my silverlight client. But I dont want all the data from table "tbLeagues" - so how would i filter it?

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

Reading many articles out there the norm seems to do this.... ( With a where clause) but even this normal select gives me no records in my datagrid.

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

        context.Load(context.GetTbLeagueQuery());
  1. What am I doing wrong?
  2. Is this the best approach?

thanks, jason

A: 

Have you tried to add the where clause in your JasonsDomainServices GetTbLeague method?

xamlgeek
many thanks - would you believe it - I tried what you suggested the first time around and it wouldn't let me put in LINQ syntax in.rebooted and when I tried it again ( As you suggested ) VS prompted me for "using System.Windos.Ria.Data;" to be added.And I started working.using System.Windows.Ria.Data; dgLeagues.ItemsSource = context.tbLeagues; context.Load( from t in context.GetTbLeagueQuery() where t.dbLeagueName.Contains("22") select t );thanks, J
jason clark