I have a function that works to save in an xml file a query, userID and userPassword that is working correctly. I also have the ability on the form for the user to type in a query to use or save. This also includes the ability with a checkbox to add text for a date range.
When I check this checkbox, the following sql code is added to the text I already typed in:
where dmv_trans_dte >= '12/31/2009 1:08:12 PM' and dmv_trans_dte <= '12/31/2009 11:59:59 PM'
The actual code to create this is:
txtSqlQuery.Text = txtSqlQuery.Text + " where dmv_trans_dte >= '" + dateTimePicker1.Text +
" " + dateTimePicker3.Text + "' and dmv_trans_dte <= '" + dateTimePicker2.Text + " " + dateTimePicker4.Text + "'";
When I try and save this I get an error and it is on centered on the "<" in the query.
Any ideas what is going on, why does it accept the ">" character?
Thanks in advance.
When I check this checkbox, the following sql code is added to the text I already typed in:
where dmv_trans_dte >= '12/31/2009 1:08:12 PM' and dmv_trans_dte <= '12/31/2009 11:59:59 PM'
The actual code to create this is:
txtSqlQuery.Text = txtSqlQuery.Text + " where dmv_trans_dte >= '" + dateTimePicker1.Text +
" " + dateTimePicker3.Text + "' and dmv_trans_dte <= '" + dateTimePicker2.Text + " " + dateTimePicker4.Text + "'";
When I try and save this I get an error and it is on centered on the "<" in the query.
Any ideas what is going on, why does it accept the ">" character?
Thanks in advance.