On Oct 2, 10:19 pm, Jonathan Pryor <[email protected]> wrote: > On Fri, 2009-10-02 at 04:20 -0700, Erickson wrote: > > is there a difference in attaching a IQueryable to a datasource? > > I have almost no background in data binding. That said... > > > > > when IQueryable was used as a return datatype such as this > ... > > cannot seem to bound it to a datasource it returns an exception > > "Complex DataBinding accepts as a data source either an IList or an > > IListSource." > > IQueryable isn't an IList or an IListSource, so that seems to be the > problem. > > > var result = > > from r in context.users > > where r.UserName.Contains(userName) > > select r; > > > return result.ToList(); > > > however this can be successfully bound to any datasource. > > And you found the solution -- give it an IList. > > I'm not entirely sure what the problem is. What you're binding to wants > an IList, so you give it one and it's happy. It doesn't want an > IQueryable (or an IEnumerable), so don't do that... > > - Jon
i just did that, but i am just wondering why it doesn't work? is there a difference between the those two in DBLinq? in Microsoft's LINQ, both are working --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DbLinq" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dblinq?hl=en -~----------~----~----~----~------~----~------~--~---
