title: conversion from string to type date is not valid
body: <p>I really need your help on this matter. I have search many similar topics about this but cannot find the right one for my program. Ill try to simplify my question and exclude other details which is not related on my concern. </p>
  
  <p>My vb program has a datetimepicker named dtpDate, 2 buttons named btnRecord_Save and btnClear_Date.</p>
  
  <p>My sql has a table named Voucher with a table named Voucher_Date (Datatype = Date)</p>
  
  <p>When my dtpdate has a date value, i have no issue as it works perfectly fine, but if i clear the date on dtpdate by pressing btnClear_date, it gives me an error (as mentioned on above title). All i wanted is if dtpDate is blank, it will store 'NULL' value on my sql (Column Name = Voucher_date).</p>
  
  <p>Here is my code for your reference, i have edited and excluded unnecessary information.</p>
  
  <p>CLASS CODE (SQLControl)</p>
  
  <pre><code>Imports System.Data.Sql
  Imports System.Data.SqlClient
  
  Public Class SQLControl
  
   Public SQLCon As New SqlConnection With {.ConnectionString i got this!!!}
   Public SQLDA As SqlDataAdapter
   Public SQLDS As DataSet
   Public Params As New List(Of SqlParameter)
   Public RecordCount As Integer
   Public Exception As String
   Private SQLCmd As SqlCommand
   Public Sub AddToVoucher(Voucher_Date As Date)
      Try
          Dim strInsert As String = "INSERT INTO Voucher (Voucher_Date) " &amp; _
                                    "VALUES (" &amp; _
                                    "'" &amp; Voucher_Date &amp; "') "
          SQLCon.Open()
          SQLCmd = New SqlCommand(strInsert, SQLCon)
          SQLCmd.ExecuteNonQuery()
          SQLCon.Close()
          MsgBox("Successfully Added Into Records!")
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
   End Sub
  End Class
  
  
  Public Class FormMain
  
   Dim sql As New SQLControl
  
   Private Sub dtpDate_ValueChanged(sender As System.Object, e As System.EventArgs) Handles dtpDate.ValueChanged
      dtpDate.CustomFormat = "dd/MM/yyyy"
   End Sub
  
   Private Sub btnClearDate_Click(sender As System.Object, e As System.EventArgs) Handles btnClearDate.Click
      dtpDate.CustomFormat = "        "
      dtpDate.Format = DateTimePickerFormat.Custom
   End Sub
  
   Private Sub btnRecord_Save_Click(sender As System.Object, e As System.EventArgs) Handles btnRecord_Save.Click
          sql.AddToVoucher(dtpDate.Text)
   End Sub
  
  End Class
  </code></pre>