0

The error I get is this:

The 'SalesValue' property on 'ItemSale' could not be set to a 'Decimal' value. 
You must set this property to a non-null value of type 'Single'.

But I already did:

[Table("ItemSales")]
public class ItemSale {
    [Key]
    public int ID { get; set; }
    ....
    public Single SalesValue { get; set; }
}

Here is my LINQ, simple enough:

            from x in database.ItemSales
            select x

I am using Entity-Framework Code First

How do I solve this?

Bill Software Engineer
  • 7,362
  • 23
  • 91
  • 174

1 Answers1

0

Have you checked the precision of the column type ? That was an error i once came along which, as far as i remember, was very similar to yours. As far as i remember, the precision had to be 2, but had another value.

b_meyer
  • 594
  • 2
  • 7