if (!this.IsPostBack)
{
DataTable dt = this.GetData("SP_Name");
rptMarkers.DataSource = dt;
rptMarkers.DataBind();
}
}
protected DataTable GetData(string query)
{
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
SqlCommand cmd = new SqlCommand(query);
cmd.Parameters.AddWithValue("@ddlyear", "2019");
cmd.Parameters.AddWithValue("@season", "K");
cmd.Parameters.AddWithValue("@usercode", "97******");
cmd.Parameters.AddWithValue("@role", "0");
cmd.CommandType = CommandType.StoredProcedure;
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
return dt;
}
}
}
}
This code bind the data to
"Trail Type"; '<%# Eval("Trail_Type") %>',
"Plot"; '<%# Eval("Plot") %>',
as below
var data = google.visualization.arrayToDataTable([
|
|
|
| {
|
| "Trail Type"; 'DEM',
|
| "Plot"; '94',
|
| }
|
|
|
| ,
|
|
|
| {
|
| "Trail Type"; 'GCA',
|
| "Plot"; '2',
|
| }
|
|
|
| ,
|
|
|
| |
|
|
| ]);
|
| |
But chart not visible on page.
can anyone help me?