文本框从十进制到字符串的隐式转换

textbox implicit conversion from decimal to string

我有这个错误

implicit conversion from decimal to string during compilation

Public Sub InvoicxeHT()
    Dim Total1 As Decimal = "0,00"
    For Each row As DataGridViewRow In DataGridView1.Rows
        Total1 += row.Cells(4).Value

    Next
    TotalHT.Text = Total1
End Sub

我能知道是什么问题吗

试试这个:

Public Sub InvoicxeHT()
    Dim Total1 As Decimal = "0,00"
    For Each row As DataGridViewRow In DataGridView1.Rows
        Total1 += CDec(row.Cells(4).Value) ' Or CInt()

    Next
    TotalHT.Text = Total1
End Sub