title: Invalid cast from Datetime to Decimal
body: <p>I am trying to sum a column of Times for total hours as shown below:</p>
  
  <pre><code>Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  
      If DataGridView1.RowCount &gt; 1 Then
  
          Dim IntTotalHours As Decimal = 0
          Dim IntPricePerhour As Integer = 0
  
          For Index As Integer = 0 To DataGridView1.RowCount - 1
              IntTotalHours += Convert.ToDecimal(DataGridView1.Rows(Index).Cells(2).Value)
  
          Next
          TextBox1.Text = IntTotalHours
          TextBox3.Text = FormatCurrency(IntTotalHours * 15)
  
      End If
  End Sub
  </code></pre>
  
  <p>But I get an error on the line:</p>
  
  <pre><code>IntTotalHours += Convert.ToDecimal(DataGridView1.Rows(Index).Cells(2).Value)
  </code></pre>
  
  <p>How do I convert Time to decimal using datagridview?</p>