private void button2_Click(object sender, EventArgs e)
{
SqlDataAdapter SDA = new SqlDataAdapter("SELECT * FROM [Order] WHERE DeliveryDate BETWEEN '" + DTpstr.Text + "' AND '" + DTPEn.Text + "' ", con);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
SDA.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (!row.IsNewRow)
lbResults.Items.Add(row.Cells[0].Value.ToString() + " " + row.Cells[1].Value.ToString() + " " + row.Cells[2].Value.ToString());
}
}
{
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
this.chart1.Series["Deliverytimes"].Points.AddXY(dataGridView1.Rows[i].Cells[0].Value.ToString(), Convert.ToDateTime(dataGridView1.Rows[i].Cells[2].Value.ToString()));