I was trying to create a table as follows,
create table table1(date1 datetime,date2 datetime);
First I tried inserting values as below,
Please Try this.
SQL Server expects dates in MM/DD/YYYY format,If English is set as your default language.Here am saving datepicker value to sql2008 database.My field type is datetime in database.dpdob is my datepicker name.
Dim test = dpdob.Text.Replace("-", "/")
Dim parts As String() = test.Split(New Char() {"/"c})
Dim firstPart As String = parts(0)
Dim thirdPart As String = parts(2)
Dim secondPart As String = parts(1)
Dim test1 = secondPart + "/" + firstPart + "/" + thirdPart
Dim dob = test1
Now use dob in your insert query.