No SmartDate Mapping

No SmartDate Mapping

Old forum URL: forums.lhotka.net/forums/t/2023.aspx


NetStream posted on Friday, December 22, 2006

When the statement ExecuteNonQuery runs I get the error - "No Mapping exists from object type Csla.SmartDate to a known managed provider native type."  ANyone seen this or know how to fix it?

Brian Criswell replied on Saturday, December 23, 2006

Without seeing code I am not sure, but are you setting the parameter value using _mySmartDate.DbValue?

xal replied on Saturday, December 23, 2006

You are probably adding a smartdate directly to the sql command.
Like:
cmd.Parameter.AddWithValue("@date",mMySmartDate)

If that is the case, then what you really need to do is:
cmd.Parameter.AddWithValue("@date",mMySmartDate.DBValue)


Andrés

NetStream replied on Monday, December 25, 2006

Thanks Andres, you hit the nail on the head.  I really appreciate your input.  Merry Christmas!

DansDreams replied on Wednesday, December 27, 2006

Just thought I'd throw in here that using the DevExpress controls I've found I can just declare a property as type DateTime? and I'm done with it.  No need for SmartDate.

Just an FYI for anybody using null-aware edit controls.

.

Copyright (c) Marimer LLC