loads of useful information, examples and tutorials pertaining to web development utilizing asp.net, c#, vb, css, xhtml, javascript, sql, xml, ajax and everything else...

 



Advertise Here
C-Sharpener.com - Programming is Easy!  Learn Asp.Net & C# in just days, Guaranteed!

The argument types 'Edm.Decimal' and 'Edm.Double' are incompatible for this operation.

by naspinski 3/3/2011 8:40:00 PM

error you may run into while making queries in Linq-to-Entities

What this is indicating is that you are comparing a Decimal data type to a number that is not a Decimal. While it may look like it, this:
0.007 // is *not* a double in .Net land

// the proper form is this:
0.007M

So instead of this query:
var query = db.aTable.Where("it.Length = 0.01");
// make sure it is this instead:
var query = db.aTable.Where("it.Length = 0.01M");

Currently rated 2.1 by 12 people

  • Currently 2.083333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

c# | entities

Related posts


Comments are closed