Home > Mobile >  textbox implicit conversion from decimal to string
textbox implicit conversion from decimal to string

Time:03-31

I have this error

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

can i know whats the problem

CodePudding user response:

Try this:

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
  • Related