Hi. I am new to the Forum and new to VB.Net. I have had extensive programming with VBA Excel and other proprietary software (PLC & Scada in the Automation fields).
My problem is as follows:
I have a Windows Form Application. I have created a XML DataSet, which has a table in it. This table has four columns. Column A is the Id column (unique key). Column B is a name column an is also has a unique value. The other columns have normal string data in them. I have a form on which I have created a ComboBox that is populated from column A. This all works as it should.
When an item is selected in the ComboBox, I would like to return the associated value from Column B into TextBox 1, Column C value into TextBox 2, etc.
Any assistance would be appreciated.
Code:Private xmlFormDataPath As String = My.Application.Info.DirectoryPath & "xmlAstroData.xml" Private Sub frmOTOParameters_Load(sender As Object, e As EventArgs) Handles MyBase.Load DsFormData.ReadXml(xmlFormDataPath) 'Clear Form Data cbOTAName.Items.Clear() txtAperture.Text = "" txtFocalLength.Text = "" txtFocalRatio.Text = "" cbEyepieceName.Items.Clear() txtEyepieceMM.Text = "" txtAFOV.Text = "" cbBarlowMag.Items.Clear() cbFocalReducer.Items.Clear() 'Populate OTA Name Combobox List cbOTAName.DataSource = DsFormData.Tables("tblOTAData") cbOTAName.DisplayMember = DsFormData.Tables("tblOTAData").Columns("otaName").ColumnName cbOTAName.Text = "Select from....." 'Populate Eyepiece Name Combobox List cbEyepieceName.Items.Clear() cbEyepieceName.DataSource = DsFormData.Tables("tblEyePieces") cbEyepieceName.DisplayMember = DsFormData.Tables("tblEyePieces").Columns("eypieceName").ColumnName cbEyepieceName.Text = "Select from....." End Sub Private Sub cbOTAName_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbOTAName.SelectedIndexChanged Dim sOTAName As String = "" Dim sAperture As String = "" Dim sFocalLength As String = "" Dim sTempValue As String sOTAName = cbOTAName.Text For Each row As DataRow In DsFormData.tblOTAData.Rows sTempValue = DsFormData.ReadXml(xmlFormDataPath) 'Column Name ?????? MessageBox.Show(sTempValue) Next row txtAperture.Text = sAperture txtFocalLength.Text = sFocalLength End Sub