Andrew Parker
asked on
selecting monthcalender date
Morning
I have an app which I need to call the date selected on the monthcalenderpicker, and send this date to a textbox.
'Code so far
Try
cmd.Connection.Open()
dr = cmd.ExecuteReader
If dr.Read Then
MsgBox("Employee Skill Combo Exists")
Else
If ComboBoxAccRoute.Text = "" Then
txtDateChosen.Text = "00/00/00"
Else
txtDateChosen.Text = ExpiryDatePicker.Text
End If
End If
Catch ex As SqlException
MessageBox.Show(ex.Message )
Finally
cmd.Connection.Close()
End Try
I have an app which I need to call the date selected on the monthcalenderpicker, and send this date to a textbox.
'Code so far
Try
cmd.Connection.Open()
dr = cmd.ExecuteReader
If dr.Read Then
MsgBox("Employee Skill Combo Exists")
Else
If ComboBoxAccRoute.Text = "" Then
txtDateChosen.Text = "00/00/00"
Else
txtDateChosen.Text = ExpiryDatePicker.Text
End If
End If
Catch ex As SqlException
MessageBox.Show(ex.Message
Finally
cmd.Connection.Close()
End Try
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
We have the System.windows.Forms.DateT imePicker
which has both date and time
Eg:
Public Sub CreateMyDateTimePicker()
' Create a new DateTimePicker control and initialize it.
Dim dateTimePicker1 As New DateTimePicker()
' Set the MinDate and MaxDate.
dateTimePicker1.MinDate = New DateTime(1985, 6, 20)
dateTimePicker1.MaxDate = DateTime.Today
' Set the CustomFormat string.
dateTimePicker1.CustomForm at = "MMMM dd, yyyy - dddd"
dateTimePicker1.Format = DateTimePickerFormat.Custo m
' Show the CheckBox and display the control as an up-down control.
dateTimePicker1.ShowCheckB ox = True
dateTimePicker1.ShowUpDown = True
End Sub 'CreateMyDateTimePicker
which has both date and time
Eg:
Public Sub CreateMyDateTimePicker()
' Create a new DateTimePicker control and initialize it.
Dim dateTimePicker1 As New DateTimePicker()
' Set the MinDate and MaxDate.
dateTimePicker1.MinDate = New DateTime(1985, 6, 20)
dateTimePicker1.MaxDate = DateTime.Today
' Set the CustomFormat string.
dateTimePicker1.CustomForm
dateTimePicker1.Format = DateTimePickerFormat.Custo
' Show the CheckBox and display the control as an up-down control.
dateTimePicker1.ShowCheckB
dateTimePicker1.ShowUpDown
End Sub 'CreateMyDateTimePicker
ASKER
How do I just have date not time?