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 selecte开发者_JAVA百科d in those 3 combo boxes so that they would be fitting in the birthday column?
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)
精彩评论