0

Hi Guys
I hope someone can help I have a form that loads a gridview at runtime based on users logon names which is pretty easy the data I load lives in an excel document, I want to be able to read the data from the datagrid view I loaded at runtime, like a sort of ini file
my question what is the syntax to read data from a a datagridview in vb.net, the datagrid is pretty simple it has only one columm and at most it has 6 rows of different information that I need to read from it.

2
Contributors
3
Replies
14
Views
7 Years
Discussion Span
Last Post by Oxiegen
0
Dim row1 As String = datagridview1.Rows(0).Cells(0).Value
Dim row2 As String = datagridview1.Rows(1).Cells(0).Value
Dim row3 As String = datagridview1.Rows(2).Cells(0).Value
Dim row4 As String = datagridview1.Rows(3).Cells(0).Value
Dim row5 As String = datagridview1.Rows(4).Cells(0).Value
Dim row6 As String = datagridview1.Rows(5).Cells(0).Value
0
Dim row1 As String = datagridview1.Rows(0).Cells(0).Value
Dim row2 As String = datagridview1.Rows(1).Cells(0).Value
Dim row3 As String = datagridview1.Rows(2).Cells(0).Value
Dim row4 As String = datagridview1.Rows(3).Cells(0).Value
Dim row5 As String = datagridview1.Rows(4).Cells(0).Value
Dim row6 As String = datagridview1.Rows(5).Cells(0).Value

Thanks for this I used a loop to increment each row.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.