Hi,
I have an windows mobile application. In the windows form of it, I have a combo box.
I load the values in the combobox on frm_load event.
Now we all know what the combo box has the facility that it allows to enter text as well as chose from the dropdown.
So when they enter the text, I want to validate it against the list that is in it.
If not then msbox error.
Can you guide me with,how to validate.
My loading of the combo box is here.
Code:Private Sub mainfrm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim con As New SqlConnection("XXXX") Try con.Open() Catch ex As Exception 'MsgBox("Problem in Connection with the SQL server") End Try Try ' filling the combobox with distinct bin numbers Dim cmd1 As New SqlCommand(" Select distinct Binnumber from [dbo].[bintable]", con) Dim rd1 As SqlDataReader = cmd1.ExecuteReader() While rd1.Read() Barcode2.Items.Add(rd1(0).ToString) End While Catch ex As Exception MsgBox("Error loading the combo box with bin numbers.") con.Close() End Try Barcode1.Focus() End Sub




Reply With Quote