title: How to insert just the date in sql using vb.net using a date time picker
body: <p>i keep getting an error when i start the form saying "unable to convert mysql date/time value to system.datetime"</p>
  
  <p>this is my code </p>
  
  <pre><code>Private Sub Add_Button1(sender As Object, e As EventArgs) Handles Add_Button.Click
      MySqlConn = New MySqlConnection
      MySqlConn.ConnectionString = "Server = Localhost; database = apartmentdb; user id = root; Password = "
      Dim Reader As MySqlDataReader
  
      Try
          MySqlConn.Open()
          Dim Query As String
          Query = "Insert into Apartmentdb.Bookings(Apartment_ID, Client_ID, Booking_start_Date, Booking_end_Date, Total_Days, Price_per_Week, Total_Price) Values ('" &amp; TextBox5.Text &amp; "', '" &amp; TextBox4.Text &amp; "', '" &amp; DateTimePicker4.Value &amp; "' , '" &amp; DateTimePicker3.Value &amp; "' ,'" &amp; TextBox3.Text &amp; "', '" &amp; TextBox2.Text &amp; "', '" &amp; TextBox1.Text &amp; "')"
          Command = New MySqlCommand(Query, MySqlConn)
          Reader = Command.ExecuteReader
  
          MessageBox.Show("Data Saved")
          MySqlConn.Close()
  
      Catch ex As Exception
          MessageBox.Show(ex.Message)
      Finally
          MySqlConn.Dispose()
  
      End Try
  
      Call GridView_load()
  
  End Sub
  </code></pre>