Tried the codes on the net concerning the error
You can only set 1 Y values for this data point. Parameter name: yValue
try
{
con.Open();
cmd = new OleDbCommand("SELECT Sum(GrandTotal) AS SumOfGrandTotal,InvoiceDate FROM Invoice GROUP BY InvoiceDate HAVING (InvoiceDate between #" + dateTimePicker1.Value + "# and #" + dateTimePicker2.Value + "#);", con);
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DataView source = new DataView(ds.Tables[0]);
chart1.DataSource = source;
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dr.Read() == true)
{
chart1.Series[0].Points.AddXY(dr["InvoiceDate"].ToString());//,dr["GrandTotal"].ToString());
//chart1.Series[0].YValuesPerPoint = 2;
}
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
I am using c# winforms. This code is for Chart Column. I want to get the date on ms-access database and get their sum of grandtotal.