Dim startdate1 As String = DateTimePicker1.Value.Date
Dim enddate As String = DateTimePicker2.Value.Date
myConnection = New SqlConnection(connectionstring)
myConnection.Open()
Dim insert As SqlCommand = New SqlCommand(" INSERT INTO Client_Details (Contract_Name ,Client_Name ,VAT_No ,Cilent_Address,Start_Date,End_Date ,Contract_Value,Telephone_No) VALUES('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox3.Text & "','" & startdate1 & "','" & enddate & "','" & TextBox7.Text & "')", myConnection)
insert.ExecuteNonQuery()
insert.Cancel()
MessageBox.Show("New Project detail is Added")
myConnection.Close()
when use this coding to insert a date value I got the error below.
"conversion failed when converting datetime from string"
I used sql 2005 & vb.net 2008