Hello Forum,

I have a dynamic LINQ-query like this:

var query = (_db.MyTable.Where("MyId == @0 And (TimeStamp >= @1 And TimeStamp 
<= @2)", Id, DateFrom, DateTo)
             .Select("new (MyId, TimeStamp)).OrderBy("TimeStamp"));

return (IEnumerable<object>)query).ToList()





The first date (DateFrom - from Database) looks like "2014-07-31 
03:12:00.000" and the second date (DateTo from user) looks like 
"01.08.2014". The SQL-Statement created from the LINQ-Statement above looks 
like below:

SELECT 
[Extent1].[MyId] AS [MyId], 
[Extent1].[TimeStamp] AS [TimeStamp], 
FROM [dbo].[MyTable] AS [Extent1]
WHERE (92 = [Extent1].[MyId]) AND 
([Extent1].[TimeStamp] >= convert(datetime2, '2014-07-31 00:00:00.0000000', 
121)) AND 
([Extent1].[TimeStamp] <= convert(datetime2, '2014-08-01 00:00:00.0000000', 
121))
ORDER BY [Extent1].[TimeStamp] ASC

Code hier eingeben...

With this SQL-Statement I get the wanted results. But the LINQ-Statement 
itself returns an empty List. Anyone know why I get no results from linq
-statement?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/dblinq.
For more options, visit https://groups.google.com/d/optout.

Reply via email to