Last post Dec 02, 2009 08:08 AM by xaeryan
Dec 01, 2009 03:32 PM|xaeryan|LINK
I am "filling-in" the partial method OnLetter_DateChanging as follows:
Partial Public Class Letters
Private Sub OnLetter_DateChanging(ByVal value As Nullable(Of Global.System.DateTime))
Dim dt As DateTime = value.Value
If dt.Year < DateTime.Now.Year Then
Throw New ValidationException("Invalid year for letter date")
Aside from the annoying fact that this is called even when the data is just being displayed (a known issue), I have another problem:
If I enter an "invalid" date value that triggers the throwing of ValidationException, I get an unhandled error in my code, instead of the nice formatted display messages as per the examples I've found. If I let it continue, it runs into the "DataSource_UpdatingOrInserting"
of the many-to-many template and throws various errors there. This is with EF v4 (.NET 4.0 beta 2).
Am I doing something stupid here? Has something changed in the latest version?
Dec 02, 2009 08:08 AM|xaeryan|LINK
FYI: I've tried using the "ImprovedDynamicValidator" as per here with no different results: