Date convertion To yyyy-mm-dd
===

cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = DateTime.Parse(txtStartDate.Text); 

The value in txtStartDate.Text is like 31-07-2012

I need to get it as 2012-07-31.

For processing in storedprocedure.

My code is like :



                cmd = new SqlCommand("DownloadtoXLSheet", conn);
                
   

                cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = DateTime.Parse(txtStartDate.Text);
                cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = DateTime.Parse(txtEndDate.Text);
                cmd.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = DropDownList1.Text.ToString();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.ExecuteNonQuery();

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt1);
help me out
