I read the data from database and return data fromat is json. using json object to preapre the chart data dynamically on page load can any one give me the solution for that.
sample code:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack) {
GetIncome();
}
}
public string GetIncome()
{
string useruniq = "xxxxx";
con = getcon.GetConnection();
cmd = new SqlCommand("xxxx", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Uuniq", SqlDbType.VarChar).Value = useruniq;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
List> rows = new List>();
Dictionary row;
foreach (DataRow dr in dt.Rows)
{
row = new Dictionary();
foreach (DataColumn col in dt.Columns)
{
row.Add(col.ColumnName, dr[col]);
row.Add(col.ColumnName, dr[col]);
}
rows.Add(row);
}
con.Close();
return serializer.Serialize(rows);
}
using above code in jqurey i need to preapre chart can any one give me solution
thanks in advance
Suraj KumarPosted Nov 1, 2018, 12:16 PM
Laxmidhar SahooPosted Nov 1, 2018, 3:58 AM