title: Conversion failed when converting date and /or time from character string
body: <p>Error is appearing in date_to and date_from while adding data into the database. 
  In sql server database the data type for date_to &amp; date_from are date. suggest some solution.</p>
  
  <pre><code>try
  {
     cmd = new SqlCommand("insert into license1 values(@l_id,@customer_id,@d_id,@device_name,@from,@to)", cn);
  
     cmd.Parameters.AddWithValue("@l_id", license_id.Text);
     cmd.Parameters.AddWithValue("@customer_id", c_comboBox4.Text);
     cmd.Parameters.AddWithValue("@d_id", d_id_comboBox4.Text);
     cmd.Parameters.AddWithValue("@device_name", d_name_comboBox5.Text);
     cmd.Parameters.AddWithValue("@to", date_to.Text);
     cmd.Parameters.AddWithValue("@from", date_from.Text);
  
     cn.Open();
     a = cmd.ExecuteNonQuery();
     if (a &gt; 0)
     {
        MessageBox.Show("Data Submitted");
     }
  
   }
   catch (Exception ex)
   {
        MessageBox.Show(ex.Message);
   }
  </code></pre>