TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harish Batchu
NA
255
70.3k
I have question regarding to load chart on page load?
Nov 1 2018 3:21 AM
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<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
Dictionary<string, object> row;
foreach (DataRow dr in dt.Rows)
{
row = new Dictionary<string, object>();
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
Reply
Answers (
2
)
transport failed error
Create Accordion for menu and submenu