I am used to using VB6 and trying to work in VB.NET as my school have switched to it.
I need to compare all the items loading into a combo box to items being read from an array from a text file so that the same text isn't added twice.
Please help me!
Here's the (probably shocking) code that does the job so far:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim stock, beverage, unit, cost, no, textline As String
Dim file_name As String = "stock.txt"
Dim itemArray() As String
Dim i
If System.IO.File.Exists(file_name) = True Then
Dim objreader As New System.IO.StreamReader("stock.txt")
Do While objreader.Peek() <> -1
textline = objreader.ReadLine()
itemArray = Split(textline, ",")
For i = 0 To 0
:confused: 'I want to put in a comparison here
ComboBrand.Items.Add(itemArray(1))
Next
Loop
End If
End Sub