display numbers in donut chart .net c#

My stored procedure returns 3 values:

Apples  Lemons  Plums 20      30      50 

I want these numbers to be visualized in a donut chart.

I tried this but it is not working the donut chart showed nothing:

SqlConnection conn = new SqlConnection(@"Data Source=*****;Database=*****;Trusted_Connection=True;"); SqlCommand cmdSum = new SqlCommand("*****", conn); cmdSum.CommandType = CommandType.StoredProcedure;  conn.Open(); SqlDataReader rdr = cmdSum.ExecuteReader();  while (rdr.Read()) {     sApples = rdr["sApples"].ToString();     sLemons = rdr["sLemons"].ToString();     sPlums = rdr["sPlums"].ToString(); }  chart2.Series[0].XValueMember = "sApples,sLemons,sPlums"; 

donut chart

Asked on August 31, 2020 in .NET,   ASP.net.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.