score:4
Accepted answer
i got the solution, what i need to do is to use "asenumerable()", here is the resolved version of my linq-
var srs = (from s in dcdistrict.scheduledreportstatus.asenumerable()
where s.reportconfigid.equals(configid)
&& s.status.hasvalue && s.status.value
&& (convert.tostring(s.sentdate).split(' ')[0]).equals(convert.tostring(datetime.now.date).split(' ')[0])
select s).firstordefault();
asenumerable() done some part of the code client side that resolves my issue.
score:2
filter as much as you can on the server and then, what you can't on the client.
var startdate = new datetime(datetime.today.year, 1, 1);
var enddate = startdate.addyears(1);
var serverquery = from s in dcdistrict.scheduledreportstatus
where s.sentdate >= startdate && s.sentdate < enddate
&& s.reportconfigid.equals(configid)
&& s.status.hasvalue && s.status.value
select s;
var clientquery = from s in serverquery
where // whatever client side filtering
select s;
Source: stackoverflow.com
Related Query
- "unrecognized expression node array index linq" exception in LINQ to SQL
- Keep Getting 'The LINQ expression node type 'Invoke' is not supported in LINQ to Entities' Exception
- Unrecognized expression node ArrayIndex using linq with predicate
- Linq code to get the index of an object in an array from an object within a list
- how to translate a linq expression into sql string use c# code
- Join Two Array based on Index and Index Value using Linq Query Expression Syntax
- What can I do to resolve a "Row not found or changed" Exception in LINQ to SQL on a SQL Server Compact Edition Database?
- "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities" - stumped!
- The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities
- How are people unit testing code that uses Linq to SQL
- The LINQ expression node type 'Invoke' is not supported in LINQ to Entities in entity framework
- Convert LINQ Expression to SQL Text without DB Context
- Equivalent of SQL Between Statement Using Linq or a Lambda expression
- Linq expression to set all values of an array to a given value
- Using C# Linq to return first index of null/empty occurrence in an array
- The LINQ expression node type 'Lambda' is not supported in LINQ to Entities
- Dynamic linq query expression tree for sql IN clause using Entity framework
- Rewriting a LINQ Expression query to enable caching SQL Execution Plan
- LINQ to SQL - select where text like string array
- Linq - Using array in Lambda expression to fetch multiple records
- How to reuse a linq expression for 'Where' when using multiple source tables
- How do I use an array of values in a LINQ Expression builder?
- Linq - Get the Index of the Last Non-Zero Number of Array
- Conditional operator in Linq Expression causes NHibernate exception
- LINQ expression is not being translated to SQL
- Expression to get LINQ with Contains to EF for SQL IN() where on entities child's property equals value
- Linq to CRM (early bound) join statement throws exception when lambda expression doesn't
- Null Reference Exception in a Dynamic LINQ Expression
- LINQ Source Code Available
- InvalidOperationException: An exception was thrown while attempting to evaluate a LINQ query parameter expression
More Query from same tag
- C#.NET LinQ remove Dupes from list with a twist
- Is it possible to Serialize a LINQ object?
- Create Dynamic Expression Tree
- Decode Xdata stored in string in c#
- C# Entity Framework Linq Where issue
- convert type of collection using linq and c#
- Get an item from a IGrouping based on the highest date
- Query Not Working for All (in Hash)
- Use eager loading / ".Include" with custom type select?
- SELECT COUNT in LINQ to SQL C#
- Delete Individual row of gridview without deleting from database
- How to call a stored procedure that returns dynamic columns in Entity Framework?
- ASP.NET MVC Recursion Procedure
- C# how to modify this method to return only with matching criteria?
- use Linq to parsing xml , import namespace. still can't read xml correctly, WHY?
- Database not updating with loop
- multiple left joins with Linq
- VB.NET LINQ Result Set Manipulation
- Linq sql - where should I put phrase with "where"
- Why Linq Query Return Duplicate column record
- Enumerable and deferred execution of a method
- Using LINQ query in model (MVC)
- Unable to query LINQ fields backed by private member
- LINQ, Combine Items with a similar value
- Cast IEnumerable<Inherited> To IEnumerable<Base>
- LINQ Join Query Structure Resulting in CS0119 Error
- Nullable comparisons in expression trees
- Insert XAttribute to existing XElement at specified position
- Linq - Select list of tags from a list objects, each containing a list of tags
- Inner join to get those not in table