```
for (DateTime date = fromDate; date <= toDate; date = date.AddDays(1))
{
   var bwSalesValue = (from r in dtSalesData.AsEnumerable()
                       where r.Field<int>("PositionId") == pdPositionId 
                       && r.Field<DateTime>("SaleDate") == date
                       select r.Field<int>("SaleValue")).FirstOrDefault();

}

```

From the above snippet `r.Field<DateTime>("SaleDate") == date` part throws exception **Specified cast is not valid**.

date variable and dtSalesData rows have the same value `3/1/2015 12:00:00 AM`

Any clue?

UPDATE==================================

Sorry friends, I did a silly mistake here. Problem is in the next line-

```
select r.Field<int>("SaleValue")).FirstOrDefault(); //Would be <decimal>

```

Please accept my apology. Thanks to all.