Bom dia. Tenho um DataGridView que busca no bancos os dados após consulta. No DataGrid possui uma coluna chamada horas trabalhadas e ao realizar o filtro gostaria de colocar um textbox com a soma dessa coluna. Estou utilizando o Visual basic 2010. Tentei o seguinte código no click do botão soma: For Each Linha As DataGridViewRow In Me.DgvProjeto.Rows Dim valor As Date If Not Linha.IsNewRow Then 'Executa a soma dos valores da coluna 9 valor += Linha.Cells(9).Value Me.TxtTotal.Text = valor End If Next O erro foi: "A conversão da cadeia de caracteres '00:00:0001/01/1900' no tipo 'Date' não é válida." No banco o tipo do dado é DateTime ------------------------------------------------------------------------------------------------------ Recebi outro código como ajuda porém ocorre o mesmo erro: Segue o código com as modificações: Private Function Total() As Date 'Dim tot As Double = 0 Dim tot As Date Dim i As Integer = 0 For i = 0 To DgvProjeto.Rows.Count - 1 tot = tot + Convert.ToDateTime(DgvProjeto.Rows(i).Cells("HorasTrabalhadas").Value) Next i Return Date.FromOADate(tot.ToOADate()) End Function Private Sub PcxTotalHoras_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PcxTotalHoras.Click If DgvProjeto.Rows.Count > 0 Then TxtTotal.Text = Total().ToString("H:mm") End If End Sub Poderiam me ajudar? Grato.