title: How To assign null values in MySql using VB.NET
body: <p>I am not sure why VB makes everything such a pain. I have a fields which stores the date and time in the format required to store in MySQL database </p>
  
  <pre><code> Dim AppDate As String = String.Empty
        If Not String.IsNullOrEmpty(Me.AppDate.Text.Trim) Then
           AppDate = Format(CDate(Me.AppDate.Text), "yyyy-MM-dd h:mm:ss")
        Else
          //Need to assign a null value to AppDate 
        End If
  </code></pre>
  
  <p>Now I need to assign the AppDate to NUll like DBNull, but I am not able to do it directly. If I change AppDate to Date then I am not getting the required format.</p>
  
  <p>Any help is appreciated .</p>
  
  <p>Thanks in Advance.</p>