You need to read each line into an instance of a type that has two properties - one for each value. You can then bind a list of those objects to the ComboBox and specify one property name as the DisplayMember and the other as the ValueMember. You can define your own type or you can just use Tuples, e.g.
Code:Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim states = (From line In File.ReadLines("file path here") Let parts = line.Split(","c) Select Tuple.Create(parts(0), parts(1))).ToArray() With ComboBox1 .DisplayMember = "Item1" .ValueMember = "Item2" .DataSource = states End With End Sub




Reply With Quote