Discussion:
Comboboxes and values
(too old to reply)
hegyestomi
2008-12-28 22:32:00 UTC
Permalink
Hi,
I need some help please:
I created a database and working now on the user interface.
Its a travel company (coursework) where I got two comboboxes on the same form.
One is the country selector, the other is the destination.
I managed to link the two together so if I select a country the just the
available destinations come up in the second combobox.
My problem is that I just cant get the right value for Destination combobox
(as a destinationId) but the combobox selected values like(-1,-2,-3??).


here is some of the code:


Private Sub CountryNameComboBox_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CountryNameComboBox.SelectedIndexChanged
Try

Me.TblDestinationTableAdapter.FillByCId(Me.DataSet1.tblDestination, New
System.Nullable(Of Integer)(CType(CountryNameComboBox.SelectedValue,
Integer)))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

If you got some idea what I do wrong or got some solution please let me know.
thanks
Tamas
hanjunling
2009-02-17 13:02:18 UTC
Permalink
good
Post by hegyestomi
Hi,
I created a database and working now on the user interface.
Its a travel company (coursework) where I got two comboboxes on the same form.
One is the country selector, the other is the destination.
I managed to link the two together so if I select a country the just the
available destinations come up in the second combobox.
My problem is that I just cant get the right value for Destination combobox
(as a destinationId) but the combobox selected values like(-1,-2,-3??).
Private Sub CountryNameComboBox_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CountryNameComboBox.SelectedIndexChanged
Try
Me.TblDestinationTableAdapter.FillByCId(Me.DataSet1.tblDestination, New
System.Nullable(Of Integer)(CType(CountryNameComboBox.SelectedValue,
Integer)))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
If you got some idea what I do wrong or got some solution please let me know.
thanks
Tamas
Loading...