title: Saving Date string to SQL Server date type column in asp.net (vb.net)
body: <p>I am a beginner in vb.net and asp.net. I am having a problem saving the date, which is a string value coming from the DevExpress datepicker control. </p>
  
  <p>The column name is <code>expiryDate</code> and its type is <code>date</code>.</p>
  
  <p>Here is my ASPX markup :</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td nowrap="nowrap" class="label" align="right" valign="top" style="width: 10%"&gt;
          Expiry Date
      &lt;/td&gt;
      &lt;td style="width: 40%" valign="top"&gt;
          &lt;dxe:ASPxDateEdit ID="expiryDate" 
                            runat="server" 
                            EditFormat="Date" 
                            Date="13/06/2014" 
                            Width="200"&gt;
          &lt;/dxe:ASPxDateEdit&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>And in C# code behind :</p>
  
  <pre><code>sqlSave = "INSERT INTO [Product] (Title, expiryDate) VALUES ("
            sqlSave += " '" &amp; txtProductName.Text.Trim().Replace("'", "''") &amp; "', "
            sqlSave += ""   &amp; expiryDate.Text &amp; " )"
  </code></pre>
  
  <p>I am using <code>expiryDate.Text</code> to save in the database but the date saved is: 1900-01-01 and sometime i get message <code>Operand type clash: int is incompatible with date</code>.</p>
  
  <p>I don't know how to fix this issue, please help?</p>