title: Visual Basic datagrid change row color when a product expired
body: <p>I have a datagrid which is connected to ms access. I have a column named "Expiration date". I am making the row of the datagrid becomes red when a product has expired. I am having trouble with this code.</p>
  
  <pre><code> Private Sub BoticaDataGridView_DataBindingComplete(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles BoticaDataGridView.DataBindingComplete
      For i = 0 To BoticaDataGridView.Rows.Count - 1
          Dim expDate As Date = BoticaDataGridView.Rows(i).Cells(5).Value
          Dim now = Date.Now
          If expDate &gt; now Then
              BoticaDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.White
          Else
              BoticaDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.Red
          End If
      Next
  End Sub
  </code></pre>
  
  <p>It says that "Conversion from type 'Integer' to type 'Date' is not valid." Please help me.</p>