My program is reading data from SQL Server like this:
if (!reader.IsDBNull(4))
{
message.WazneDo = reader.GetDateTime(4);
}
This code read datetime from SQL Server. Then I will load it to datagridview:
WypozyczZwrocDb _dost1 = new WypozyczZwrocDb();
Global.listWypozyczZwroc = _dost1.PokazZar();
Global.fMain.Tabela.DataSource = Global.listWypozyczZwroc;
How to compare with today's date? I want change the row color.
I tried:
DateTime dzis = DateTime.Now;
if(Tabela.Rows[Tabela.CurrentCell.RowIndex].Cells[4].Value > dzis)
if(Tabela.Rows[Tabela.CurrentCell.RowIndex].Cells[4].Value > dzis.ToString())