2009-09-14 85 views

回答

3

您可以使用DateTime的ToShortDateString()方法。 您也可以使用這樣的事情:

DateTime dateTimeObject = Convert.ToDateTime("9/14/2009 12:00:00 AM"); 
dateTimeObject.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); 
+0

感謝您的信息。 – 2009-10-07 16:55:50

0
DateTime dt = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); 
    qry = "select taxpercentage from tbl_tax where effectivedate contains '" + dt+ "'"; 
    con.returnscalar(qry); what is wrong in this