tags:

views:

40

answers:

1

I have this, birthday selection which is in 3 combobox, 1 for month, 1 for day and 1 for year. But my database table has only this birthday attribute(no year, month or day). How can I combine the items that are selected in those 3 combo boxes so that they would be fitting in the birthday column?

+2  A: 

If the items in your combobox are strings, you could do something like this:

Dim Day As Integer = Integer.Parse(ComboBoxDay.SelectedItem.ToString())
Dim Month As Integer = Integer.Parse(ComboBoxMonth.SelectedItem.ToString())
Dim Year As Integer = Integer.Parse(ComboBoxYear.SelectedItem.ToString())

Dim MyDate As New DateTime(Year, Month, Day)
Javier Morillo
thans user225269. And... are you using combobox for an special reason? you may want to take a look at DateTimePicker or MonthCalendar controls...? :-)
Javier Morillo