using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public partial class piechart : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=AAPTI\\SQLEXPRESS;Initial Catalog=prashanth;Integrated
Security=True");
protected void Page_Load(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("select * from pie", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();//backend data was display in frenend
while (dr.Read())
{
PieChart1.PieChartValues.Add(new AjaxControlToolkit.PieChartValue
{
Category = dr[0].ToString(),
Data = Convert.ToDecimal(dr[1].ToString()) //convert.todecimal was convert the decimal values
});
}
}
}
No comments:
Post a Comment