I want to check the expiration date that display in my datagridview. I have a code but not work for me.
private void NotificationForForm()
{
foreach (DataGridViewRow drow in dataGridView2.Rows)
{
DateTime expdate = DateTime.Parse(drow.Cells[12].Value.ToString());
TimeSpan tmspn = expdate - DateTime.Now.Date;
if (tmspn.Days < 1)
{
notification("WARNING", "Attention! A vehicle schedule for nmaintenance is detected. nPlease check your car in your garage.");
}
}
}
I want to show notification if they have expired date.