ASP.NET 1.x and 2.0 Application DesignApplication design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I am working in Visual Studeo on an aspx.cs page. I have a datagrid that retrieves information from a MySQL DB. I am having problems with the DateTime in the Select statement. I am trying to compare two dates with either the < or the > operators. I have a DateTime variable that loads the date I want. The error that I am getting is that the DateTime variable automatically adds the time 12:00 AM to the end of the date I specify as date1. My Select statement reads the 12:00 AM and doesn't recognize it and throws an error. In C# how can I get around this error? Any ideas?
DateTime date1 = new DateTime(2006, 10, 4);
string strFOSFull = "SELECT contest, payment_type, cc_amount,
payment_dttm FROM footballd.fb06_payment";
strFOSFull += " WHERE contest = 'FBFULL2006' OR contest
= 'FBMID2006' AND ";
strFOSFull += "payment_type = 'FOSDOLLARS' AND payment_dttm < ";
strFOSFull += date1;
strFOSFull += " ORDER BY payment_dttm";