I don't use MySQL but I assume that it is similar to SQL Server on this issue. Date fields don't really have a null value so you have to assign them a minimum value, such as DateTime.MinValue.
>Hi,
>
>I have error message :Object cannot be cast from DBNull to other types. when i try to assign null value to poDate data field. My database is mySql.
>
>
>
>
> protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
> {
> if (e.NewValues["poDate"] == null)
> e.NewValues["poDate"] = DBNull.Value ;
>
>
>
>
>How to solve this problem?
>
>TIA.
Linda Harmes
HiBit Technologies, Inc.