Hallo Leute, ich brauche etwas Hilfe, um die Grafik in Windows Forms Application zu zeichnen.Drawig Graphics in Windows Forms Anwendung C#
heruntergeladen I Nevron Chart for .NET Community Edition von hier:
https://www.nevron.com/products-dot-net-chart-free-control
Und ich ziehe ein Diagramm von Tool in Windows Forms-Anwendung
Ich mache Verbindung in der Tabelle mit MySql So aber Ich muss die Abfrage in das Diagramm exportieren.
mein Code:
private void chart1_Click(object sender, EventArgs e) {
string MyConString3 = "SERVER=localhost;" + "DATABASE=hydrodb;" +
"UID=root;" + "PASSWORD=;";
MySqlConnection connection3 = new MySqlConnection(MyConString3);
string command3 = "select year(Dat),month(Dat),min(vkolmin),avg(Vkolsre),Max(Vkolmax) from hydmes where station='"
+ comboBox1.SelectedItem.ToString() + "' and Dat between '"
+ comboBox2.SelectedItem.ToString() + "' and '" + comboBox3.SelectedItem.ToString()
+ "' group by year(dat),month(Dat)";
MySqlDataAdapter da3 = new MySqlDataAdapter(command3, connection3);
DataTable dt3 = new DataTable();
da3.Fill(dt3);
string s = "";
foreach (DataRow row in dt3.Rows) {
string rowz = string.Format("{0}, {1}, {2}, {3}, {4}", row.ItemArray[0], row.ItemArray[1], row.ItemArray[2],
row.ItemArray[3], row.ItemArray[4]);
s += "-" + rowz;
}
connection3.Close();
}
Ich bin nicht sicher, ob ich foreach brauchen?
ich diese Abfrage von
string command3 = "select year(Dat),month(Dat),min(vkolmin),avg(Vkolsre),Max(Vkolmax) from hydmes where station='"
+ comboBox1.SelectedItem.ToString() + "' and Dat between '"
+ comboBox2.SelectedItem.ToString() + "' and '" + comboBox3.SelectedItem.ToString()
+ "' group by year(dat),month(Dat)";`
In der Tabelle exportieren müssen?
Einige Hilfe mit dem Code?
Dies ist nicht klar, was Sie tun, mit der Zeilen in 'dt3'? Sie müssen die Abfrage im Diagramm exportieren, nur die Grafik des Diagramms oder die SQL-Anweisung? und wo ordnen Sie die Diagrammdatenquelle zu? –
Können Sie mir bitte den Beispielcode geben? –
Dies ist mein String für db, String MyConString3 = "SERVER = localhost;" + "DATENBANK = hydrodb;" + "UID = Wurzel;" + "PASSWORD =;"; –