Hello everyone,
I am having some problem with the where condition in a query.
the code below is working fine, until its select * from table.
but as soon as I put the where condition, I saw a blank graph.
thus, the problem is not with the graph, but with the query.
here, out_table is the table name.
I am not able to figure it out.
Please help.
code:
string dt_start = dateTimePicker1.Value.ToShortDateString();
string dt_end = dateTimePicker2.Value.ToShortDateString();
string mySelectQuery2 = "Select * from " + in_table + " WHERE Date Between " + dt_start + " and " + dt_end + " ";
OleDbDataAdapter da2 = new OleDbDataAdapter(mySelectQuery2, con);
DataSet ds2 = new DataSet();
da2.Fill(ds2, in_table);
DataView firstView2 = new DataView(ds2.Tables[0]);
Chart1.Series[1].Points.DataBindXY(firstView2, "ID", firstView2, "Close");
EDIT:: sorry i didn't realize that I posted incomplete code. this is the full code.
I am taking the dates from a date time picker and storing it as string. is it ok?
updated the code with this code too.