Hi,
i want to total the values in column9 in Patientdatagridview to a textbox1.
here is my code but it displayes each value, not the total.
e.g. if values are 200, 200, 200 then it should display 600
but here it says 0200200200
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tot As String = 0
For i As Integer = 0 To PatientDetailsDataGridView.RowCount - 1
tot += PatientDetailsDataGridView.Rows(i).Cells(8).Value
Next
If tot = 0 Then
MessageBox.Show("No Records Found")
End If
TextBox1.Text = tot.ToString()
End Sub