I want to compare cell(Datetime) value to empty or "None".If it is not empty or none then after it will add the parameter.I would greatly appreciate of your help.
Thanks,It gives me can't convert date time to string error
command.Parameters.AddWithValue("@pin", row.Cell(2).GetValue<string>());
command.Parameters.AddWithValue("@Amount", row.Cell(3).GetValue<int>());
if(row.Cell(4).GetValue<DateTime>() == "" || row.Cell(4).GetValue<DateTime>() =="none")
{
}
command.Parameters.AddWithValue("@Expirydate", row.Cell(4).GetValue<DateTime>());
command.ExecuteNonQuery();