public void GetData() { String constr = System.Configuration.ConfigurationManager.ConnectionStrings["web"].ToString(); //MySqlConnection con = new MySqlConnection(constr); using (MySqlConnection con = new MySqlConnection(constr)) { MySqlCommand cmd = new MySqlCommand("select " + col1.Text.ToString() + ", AVG(" + col2.Text.ToString() + ") from avance_presupuestario group by "+col1.Text, con); //Series s = Chart1.Series["Series1"]; Series series = Chart1.Series["Series1"]; con.Open(); MySqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { series.Points.AddXY(rdr[col1.Text].ToString(), rdr[col2.Text].ToString()); //this.Chart1.Series["Series1"].Points.AddXY(rdr.GetString(col1.Text), rdr.GetInt32(col2.Text)); } } }
MySqlCommand cmd = new MySqlCommand("select " + col1.Text.ToString() + ", AVG(" + col2.Text.ToString() + ") AS " + col2.Text + " from avance_actividad group by " + col1.Text, con);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)