My pseudocode is the following -Select a textfile through a button and collect information. -divide the data; Let data = line.Split(","c) -Move the data to the appropriate area on the program -The data would look like; Bugs Bunny,VB101,Fall 2013,bugs.jpg,85,100,80,92,70,95,88,92 -Im trying to put the Name, Class, Semester into a label, the bugs.jpg into a picturebox, and then put the rest of the info(testScores) into a DataGrid. Is it possible to grab these values and split them up to different areas of the program?
This is my code as of now; I know it needs lots of work but this is where I'm currently at.
Public Class Form1
Dim student As String
Dim subject As String
Dim semester As String
Dim image As Image
Private Sub btnSelect_Click(sender As System.Object, e As System.EventArgs) Handles btnSelect.Click
Dim textFile As String
OpenFileDialog1.ShowDialog() 'Open dialog box appears and program pauses until a text file is selected
textFile = OpenFileDialog1.FileName
'Dim student() As String = IO.File.ReadAllLines(textFile)
Dim query = From line In IO.File.ReadAllLines(textFile)
Let data = line.Split(","c)
Let student = data(0)
Let subject = data(1)
Let semester = data(2)
Let image = data(3)
Let p1 = data(4)
Let p2 = data(5)
Let p3 = data(6)
Let p4 = data(7)
Let p5 = data(8)
Let p6 = data(9)
Let exam1 = data(10)
Let exam2 = data(11)
dgvOutput.DataSource = query.ToList
dgvOutput.CurrentCell = Nothing
dgvOutput.Columns("P1").HeaderText = "P1"
dgvOutput.Columns("P2").HeaderText = "P2"
dgvOutput.Columns("P3").HeaderText = "P3"
dgvOutput.Columns("P4").HeaderText = "P4"
dgvOutput.Columns("P5").HeaderText = "P5"
dgvOutput.Columns("P6").HeaderText = "P6"
dgvOutput.Columns("exam1").HeaderText = "exam1"
dgvOutput.Columns("exam2").HeaderText = "exam2"
End Sub
End Class