tags:

views:

29

answers:

1
public class Service1 : IService1
{
    [OperationContract]
    public List<decmal> GetEnterCounts(DateTime StartTime, DateTime EndTime)
    {
        var db = new FACT_ENTER_EXIT();
        return (from e in **db.ENTER_CNT** where StartTime < db.DATE_ID && db.DATE_ID > EndTime select e).ToList();
    }
}

Ok, so I have this database FACT_ENTER_EXIT containing the field ENTER_CNT (nullable = false, type = decimal) which I want to return as a list

VS2010 spits out the following error at 'db.ENTER_CNT':

Error 1 Could not find an implementation of the query pattern for source type 'decimal'. 'Where' not found.

I must be missing something, could someone please point out where I'm going wrong??

Thanks in advance, Tom

+2  A: 

You want to select from the table, not from a column, then select from your column.

Try:

from e in db.MyTable
where StartTime < e.DATE_ID && e.DATE_ID > EndTime
select e.ENTER_CNT

This resembles the following SQL:

SELECT e.ENTER_CNT
FROM MyTable e
WHERE @StartTime < e.DATE_ID AND e.DATE_ID > @EndTime
lc
Sorry, when I said database FACT_ENTER_EXIT, I meant table..the FACT_ENTER_EXIT table comes from a data warehouseI am not trying to create any tables!
Tom Kong