mercredi 26 septembre 2018

binding chart from sql server database in ASP.Net Web Form

i have a web form , in this web form i have a chart i try to bind this chart by data from sql server database using a query , i used a way that i used always in C# Desktop application , this is my code , and i wish someone help me.

this code in pageload event

        string Query_FL = "Select FL,Count(CD_STG) From STG Group By FL";
        CMD = new SqlCommand(Query_FL, CONN.cn);
        DR = CMD.ExecuteReader();
        while (DR.Read())
        {
            Chart1.Series[0].Points.AddXY(DR.GetValue(0).ToString(), DR.GetInt32(1));
        }




Aucun commentaire:

Enregistrer un commentaire