I have database connected to my app in vb.net
if i want to get the value from any row or column i use this code and it's work fine
DataGridView1.Rows(1).Cells(1).Value.ToString
my problem is i have table contain 14 row and i want to make loop to check the first cell in every row if it's contain specific value to do other task
if i use the variable i in counter i got an error
in this code
Private Sub Button24_Click(sender As Object, e As EventArgs) Handles Button24.Click
Dim see As String
For i As Int32 = 0 To 14
see = DataGridView1.Rows(i).Cells(1).Value.ToString
If see = "FLOWRATE" Then
TextBox11.Text = TextBox11.Text & see & " "
End If
Next
End Sub
when i press the button i got this error
An unhandled exception of type 'System.NullReferenceException' occurred in project1.exe
Additional information: Object reference not set to an instance of an object.