i can't make a sum of column in datatagridview

  • Thread starter Thread starter Houssem12
  • Start date Start date
H

Houssem12

Guest
when i execute sum with column"Qte" type is integer is work with datagrid also with datatable

when i change Column to "PU" not (error is {La conversion de la chaîne "30.1" en type 'Double' n'est pas valide.'
}

Dim sum As Double
For i = 0 To DataGridView1.Rows.Count - 1
sum += DataGridView1.Rows(i).Cells(2).Value
Next
MsgBox(sum)



Dim sum As Object

sum = dt.Compute("Sum(Qte)", "")

MsgBox(sum.ToString)

in datatable i have error ('Utilisation non valide de la fonction d'agrégation Sum() et du type : String.'
)

Continue reading...
 
Back
Top