hi im a noob in vb and i need some help i want to read from the files teachers code and from the file studentscourse bu i only want to get the results if fileds(1) of teacherscourse is equal to the loggin basicly i a teacher to enter his Teacher id number and only get the classes that are register for him
thank you in advance
Private Sub ComboboxStudentCao(ByVal _filepath2 As String, ByVal _filapeat1 As String, ByRef cbx As ComboBox)
Dim sreader As New StreamReader(Application.StartupPath & "\TeachersCourses.dat")
Dim fields() As String
Dim line As String
line = sreader.ReadLine
Dim Sreader1 As New StreamReader(Application.StartupPath & "\StudentsCourses.dat")
Dim fields1() As String
Dim line1 As String
line1 = Sreader1.ReadLine
Do Until line = Nothing
fields = line.Split(CChar(","))
If (MaskedTextBoxLogin.Text = fields(1)) Then
Do Until line1 = Nothing
fields1 = line1.Split((CChar(",")))
cbx.Items.Add(fields1(0) & "," & fields1(1) & "," & fields1(2))
line1 = Sreader1.ReadLine
Loop
Sreader1.Close()
End If
line = sreader.ReadLine
Loop
sreader.Close()
End Sub