I have this code
Dim conex As SqlConnection = New SqlConnection(conxst)
Dim caixa As Integer = ComboBox1.SelectedItem
Dim verdat As Date = DateTimePicker1.Text
Dim verdat1 As Date = "05/07/2012"
conex.Open()
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New SqlDataAdapter("select codigo,data,horario from alteraca where data = '" & verdat1 & "' ", conex)
da.Fill(dt)
this code work when verdat1 is in the format “mm/dd/yyyy” , how i convert the date from mine datetimepicker (dd/mm/yyyy) to the format “mm/dd/yyyy” to place in the statment??? Thanks.
With
You can select how the date is converted to a string.
Also, you can set the
dateTimePickerCustom Format as you wish :