Hello! I'm Kaushik. I have a problem while trying to draw a chart dynamically using "amcharts" (chart api based on javascript). the problem may be explained as follows:
I have this code in my code behind file in asp.net.
public partial class JSONData : System.Web.UI.Page
{
public string jsondata=GetJsonData();
protected void Page_Load(object sender, EventArgs e)
{
}
public static string GetJsonData()
{
//sql connection
SqlConnection con = new SqlConnection();
con.ConnectionString = "Initial Catalog=asti;Data Source=\Sqlexpress;user ID=sa;password=pass";
string query = "select [Subject Name], [Total] from [data] where [Year]='1' and [Student ID]='1234567897'";
con.Open();
SqlCommand cmd = new SqlCommand(query, con);
SqlDataReader dr;
dr = cmd.ExecuteReader();
//creating a JSON string to describe the data from the database
StringBuilder JSON = new StringBuilder();
string prefix = "" ...
Go to the complete details ...