I get the Error
Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DateTime' and'System.DBNull'
with the Code (in the 3rd line)
DateTime? BirthDate = GetDate(PersonID);
System.Data.SqlClient.SqlCommand myCommand = new System.Data.SqlClient.SqlCommand(cStatement, myConnection);
myCommand.Parameters.AddWithValue("@BirthDate", BirthDate.HasValue ? BirthDate.Value : DBNull.Value);
How can i avoid this error?