Misaz
Misaz

Reputation: 3985

When converting data type datetime overflow occurred

i am working with localDB on Windows Phone and i want to work with datetime. Everytime i get error

An exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.Linq.ni.dll but was not handled in user code

in inner exception is

When converting data type datetime overflow occurred.

Column is defined simply (VB.NET)

<Column(CanBeNull:=True)>
Public Property Expiration As DateTime

Why i everytime get error When converting data type datetime overflow occurred?

Upvotes: 0

Views: 277

Answers (1)

Rich
Rich

Reputation: 26

I would make sure the date in the database is not out of the upper or lower bounds of the data type within your programming language (Forget what it is off hand). An example would be Microsoft's SQL server's minimum date time is less than the minimum date time in C#, which results in an error if this is not accounted for.

Also, obviously make sure the database object is not null.

Upvotes: 1

Related Questions