This question is locked. New answers and comments are not allowed.
I'm having issues filtering an OpenAccess model with LINQ. Here's the scenario: I'm generating an array of IDs from the selected items of a RadGrid that I want to use to filter the EntitiesModel:
However, I get the following error when I run the code. No mention of it in any of my searches.
Anyone else seen this error before? Or have a better idea how to accomplish what I'm looking for?
public ArrayList GetTelerikGridSelections(Telerik.Web.UI.RadGrid grid){ ArrayList selectedItems = new ArrayList(); if (grid.MasterTableView.DataKeyNames.Length > 0) { string key = grid.MasterTableView.DataKeyNames[0]; for (int i = 0; i < grid.SelectedItems.Count; i++) { selectedItems.Add((int)grid.MasterTableView.DataKeyValues[grid.SelectedItems[i].ItemIndex][key]); } } using (GlobalLabManager.GLMEntitiesModel ctx = new GlobalLabManager.GLMEntitiesModel()) { var q = from i in ctx.Reservations where selectedItems.Contains(i.ResourceFK) select i; schd_Resources.DataSource = q; schd_Resources.Rebind(); }}However, I get the following error when I run the code. No mention of it in any of my searches.
An exception occured during the execution of 'Extent<GlobalLabManager.Reservation>().Where(r => value(Schedule+<>c__DisplayClass0).selectedItems.Contains(Convert(r.ResourceFK)))'. Failure: Execution of 'System.Collections.ArrayList:Contains(Object)' on the database server side currently not implemented.See InnerException for more details.Complete Expression:.Call System.Linq.Queryable.Where( .Constant<Telerik.OpenAccess.Query.ExtentQueryImpl`1[GlobalLabManager.Reservation]>(Extent<GlobalLabManager.Reservation>()), '(.Lambda #Lambda1<System.Func`2[GlobalLabManager.Reservation,System.Boolean]>)).Lambda #Lambda1<System.Func`2[GlobalLabManager.Reservation,System.Boolean]>(GlobalLabManager.Reservation $r) { .Call (.Constant<Schedule+<>c__DisplayClass0>(Schedule+<>c__DisplayClass0).selectedItems).Contains((System.Object)$r.ResourceFK)Anyone else seen this error before? Or have a better idea how to accomplish what I'm looking for?