Datagrid - Delete Date - Handle Null

lorena

Centurion
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
I have an asp.net datagrid and when I delete a date from a date field, the value is set to 1/1/1900. What do I need to do to just set it to null?
Here is the code for the value:
Visual Basic:
If CType(e.Item.FindControl("txtEditSchedComplDate"), TextBox).Text <> "" then
      SchedComplDate = Convert.ToString(CType(e.Item.FindControl("txtEditSchedComplDate"), TextBox).Text)
    Else
      SchedComplDate = DBNull.Value.ToString      
    End If
The variable SchedComplDate is dimmed as Object.
Any help/advice would be appreciated.
 
Back
Top