Hello,
I am trying to match the values of a combo box which are typed inside a combo box with the comb box items, which are bind to a datasource. i can see the items in the combo box and if i get the selecteditem its working fine means nothing is wrong with the connection and other things.
but when im trying to match the values im getting this error:
System.Data.Dat aRowView
and this error continues to display equal to the number of rows inside table. im using the following code:
i have already set the display member of the combo box. everything is done from the property sheet using visual studio. i just want to match the text against the items of the combo box. for example in pseudo code
if comboBox.text <> combobox.items. item then
''add into the database
end if
here i just need to check if the typed values are already in the combo box's items collection. please tell me how i can check this.
thanx
I am trying to match the values of a combo box which are typed inside a combo box with the comb box items, which are bind to a datasource. i can see the items in the combo box and if i get the selecteditem its working fine means nothing is wrong with the connection and other things.
but when im trying to match the values im getting this error:
System.Data.Dat aRowView
and this error continues to display equal to the number of rows inside table. im using the following code:
Code:
Public Class admForm
Dim itm As Object
Dim result As String
Private Sub admForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'admDataSet.tblAdm' table. You can move, or remove it, as needed.
Me.TblAdmTableAdapter.Fill(Me.admDataSet.tblAdm)
End Sub
Private Sub cboAdm_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboAdm.LostFocus
For Each itm As Object In cboAdm.Items
result = itm.ToString()
If result <> Me.cboAdm.Text Then
MsgBox(result)
End If
Next
End Sub
End Class
if comboBox.text <> combobox.items. item then
''add into the database
end if
here i just need to check if the typed values are already in the combo box's items collection. please tell me how i can check this.
thanx
Comment