I need to get all the cell values in a colum.
I have Tried the following code below, but it is only returning the value of the Last Row in the column.
So if my column were...
| COL 1 | |COL 2| |COL 3|.....
12345
12345
12345
2468
It would only return 2468 in a textbox
I have Tried the following code below, but it is only returning the value of the Last Row in the column.
So if my column were...
| COL 1 | |COL 2| |COL 3|.....
12345
12345
12345
2468
It would only return 2468 in a textbox
Code:
For Each dr As DataGridViewRow In dataGridView.Rows
Dim col1 As String = dr.Cells("Col1").Value.ToString()
Dim col2 As String = dr.Cells("Col2").Value.ToString()
Dim col3 As String = dr.Cells("Col3").Value.ToString()
Next