title: Date conversion from C# to MySql Format
body: <p>How to convert C# datetime to MySql Datetime format. I am getting value from text box like 7/27/2011 this format. But i want to convert in this format 2011-7-27. So here i am stuking. Please help me. My objective is to filter the record between two dates and show in a listview control in asp.net.
  Here is my code:</p>
  
  <pre><code>DateTime dt1 = Convert.ToDateTime(txtToDate.Text);
    DateTime dt2 = Convert.ToDateTime(txtFromDate.Text);
              lvAlert.DataSource = facade.GetAlertsByDate(dt1, dt2);
              lvAlert.DataBind();
  </code></pre>