I'm having issues with my DataGridView not displaying the proper results, below I'll post my code, some of it is commented out because I don't want it to sort in descending order yet because I can't even get it to display properly. What am I missing? When I click my button, the grid creates the correct number of boxes for the results, however they are all empty. An example of one line from the text file is something such as "American Express,AXP,NYSE,Consumer finance,90.73,93.04,5.56,1.01" I also want to note that this is my first time using structures and trying to understand it, so let me know if I'm doing anything wrong, thanks!
Public Class frmDow
Structure stock
Dim company As String
Dim symbol As String
Dim exchange As String
Dim industry As String
Dim price2013 As Double
Dim price2014 As Double
Dim earningsPerShare As Double
Dim dividend As Double
End Structure
Private Sub btnDetermine_Click(sender As Object, e As EventArgs) Handles btnDetermine.Click
Dim inputData() As String = IO.File.ReadAllLines("DOW2014.txt")
Dim stockData(240) As stock
Dim line, data() As String
'Dim yield As Double
For i As Integer = 0 To (inputData.Length - 1)
line = inputData(i)
data = line.Split(","c)
stockData(i).company = data(0)
stockData(i).symbol = data(1)
stockData(i).price2014 = CDbl(data(5))
stockData(i).dividend = CDbl(data(7))
Next
dgvResults.DataSource = stockData
' Dim stockQuery = From stock In stockData
'Where data(7) / data(5) = yield
'Order By yield Descending
'Select Case stock
End Sub
End Class