1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| DataTable table2 = new DataTable("MyTable");//Tabelle initialisieren
using (SqlConnection connection = new SqlConnection(@"server=sql3; database=BarForce; Trusted_Connection=yes; connection timeout=120"))
{
connection.Open();
//using gibt verwendete Ressourcen nach der Verwendung automatisch wieder frei - auch im Fehlerfall
using (SqlCommand command2 = new SqlCommand("USE BarForce SELECT CONVERT(date, First) AS D3, COUNT(CONVERT(date, First)) AS A3 FROM SlitteApp WHERE First IS NOT NULL GROUP BY CONVERT(date, First) ORDER BY CONVERT(date, First)", connection))
using (var adapter = new SqlDataAdapter(command2))
{
adapter.Fill(table2);
}
}
connection.Close();
}
var series2 = new Series(" FirstDn");
series2.Points.DataBind(("USE BarForce SELECT CONVERT(date, First) AS D3, COUNT(CONVERT(date, First)) AS A3 FROM SlitteApp WHERE First IS NOT NULL GROUP BY CONVERT(date, First ORDER BY CONVERT(date, First)"), "X", "Y", null);
series2.XValueType = ChartValueType.Date; |
Partager