Icon View Incident Report

Serious Serious
Reported By: Jan-Erik Johansen
Reported On: 7/26/2008
For: Version 2.01 Build 1
# 2718 Setting a Date/Time Value in .NET Data Provider Causes Invalid Cast Error

I'm having serious problems using the Date datatype with ASP.NET.

Lets say I have the following table definition

UID Integer
RegDate Date

and the following data
1 12/13/1994
2 11/17/1999

When I display the data in a Grid (either the standard GridView or Developer Express APSXGridView) the data is shown as
1 12/13/1994 12:00:00 AM
2 11/17/1999 12:00:00 AM

Notice that 12:00:00 AM is displayed as if it was a DateTime field. (.NET does not have a Date datatype, only a DateTime datatype so I don't know if the time part is added by you or the .NET framework)

If I edit and try to update the record I get an error "Specified cast is not valid" and an Exception is thrown.

[InvalidCastException: Specified cast is not Valid.]
Elevate.ElevateDB.Data.Engine.TEDBValue.SetAsVariant(Object Value) + 606

Resolution Resolution
Fixed Problem on 7/26/2008 in version 2.01 build 4

Products Affected Products Affected
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial