How do you cast date type to null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to return a null for DateTime type. here is what I am using but it is not workin

private DateTime SaleDate(

return(Convert.ToDateTime(DBNull.Value)); //fi
}
 
Hi Anon,

You can't set DateTime to null.
Instead you should return an object an return null or DBNull.Value.
 
Back
Top