I found the code on another Forum compliments of Neil. Neil whoever you are
THANK YOU!!! I have been trying to figure it out for days. Here is the code, so hopefully you or someone else doesn't have to waste valuable time trying to figure it out....
In order to allow null dates using Asp.net 2 you have to provide Event Handlers for the Item Updating and Item Inserting Events....
Code:
Protected Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles FormView1.ItemUpdating
If e.NewValues("DateField").ToString() = "" Then
e.NewValues("DateField") = DBNull.Value
End If
End Sub
Protected Sub FormView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormView1.ItemInserting
If e.Values("DateField").ToString() = "" Then
e.Values("DateField") = DBNull.Value
End If
End Sub
<asp:FormView ID="FormView1" runat="server" DataKeyNames="EventID" OnItemInserting="FormView1_ItemInserting" OnItemUpdating="FormView1_ItemUpdating" DataSourceID="AccessDataSource1"
Width="85%">