I'm trying to simply open streamreader to read a SIMPLE text file and display it. I keep getting an error saying it can't find my text file. What's up with this? I've put the text file in the bin folder like my teacher told me to and I've also tried using the exact path to the file. Any suggestions?


Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim numOfStudents As Integer = 1
Dim numOf50Less As Integer = 0
Dim totalOfGrades As Single
Dim is50Less As Boolean = False

'Open the stream reader
Dim Name As String
Dim Grade As Integer
Dim Data As IO.StreamReader = IO.File.OpenText("Data.TXT")


'Go through each item in the file in which the number of grades
'is the same as the number of students and all numbers and grades
'are mixed up
lstDisplay.Items.Clear()

Do While Data.Peek <> -1
Name = CStr(Data.ReadLine())
Grade = CInt(Data.ReadLine())
lstDisplay.Items.Add(Name & Grade)
Loop
'Close th streamreader
Data.Close()

End Sub
End Class