I have an issue within VB Express 2008 which I am struggling to resolve.
I am trying to take the information from 3 columns in a CSV file (ServerRef, ServerName, ServerIP) with no header row and populate 3 combobox's for users to select from to initiate an RDP connection.
So far I have gotten the following code, but I'm unable to use the information in the combobox's in other sub-routines and seem unable to move the information into a text box or dim's value field...
Private Sub Testing_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Servers = (From line In IO.File.ReadAllLines("c:\Testing\Servers.csv") _
Where line.Length > 0 _
Let Items = line.Split(","c) _
Select New With _
{.ServRef = Items(0), _
.ServName = Items(1), _
.ServIP = Items(2) _
} _
).ToList
For Each Machine In Servers
Console.WriteLine("[{0} [{1}] [{2}]", _
Machine.ServRef, _
Machine.ServName, _
Machine.ServIP _
)
Next
ComboBox1.DataSource = Servers
ComboBox1.DisplayMember = "ServRef"
ComboBox2.DataSource = Servers
ComboBox2.DisplayMember = "ServName"
ComboBox3.DataSource = Servers
ComboBox3.DisplayMember = "ServIP"
End Sub
Any help greatly received