I am testing an application on server with SQL Server 2005 and I am getting the following error (the application runs fine with SQL Server 2008 R2 and 2012 versions).
There is no store type corresponding to the conceptual side type 'Edm.Time(Nullable=True,DefaultValue=,Precision=)' of PrimitiveType 'Time'.`
The code inside the Controller that might responsible for the error is ('might' because when this code is invoked the database does not exist yet and Entity Framework is supposed to generate the database)
var tempRegistrations = db.Registrations.Where(t => t.DateExpires < DateTime.Now).ToList();
The code in my Model responsible for the entry in question is
public class Registrations
{
public int RegistrationsId { get; set; }
// ...
public DateTime? DateExpires { get; set; }
}
Both, SQL Server 2008 R2 and 2012 versions had datetime data type (nullable as well) in the generated table. I am quite sure SQL Server 2005 has datetime datatype. So what is wrong here?
Thanks.
Seems SQL 2005 doesn't support the Time datatype, which is what it's trying to map it to. Perhaps change it on the Edm side to use datetime?
http://msdn.microsoft.com/en-us/library/bb896344.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With