when we select value from dropdown then i try to display highcharts according to dropdown value for this i try this
What I have tried:
[WebMethod]
public static string jqufunc(int year)
{
string res = "[";
ProjectdbEntities a = new ProjectdbEntities();
var b = a.Catg_type;
foreach (var c in b)
{
res += "'" + c.Catg_type1 + "',";
}
res = res.Substring(0, res.Length - 1);
res += "]";
var allprogs = a.Program_type;
string res2 = "[";
foreach (var pr in allprogs)
{
res2 += "{name: '" + pr.Prog_name + "',";
var yearget = a.Year_info;
foreach (var yg in yearget)
{
res2 += "'" +yg.year + "',";
var allcats = a.Catg_type;
res2 += "data:[";
foreach (var ct in allcats)
{
res2 += a.Std_info.Where(t => t.Catg_id == ct.Catg_id && t.Prog_id == pr.Prog_id && t.year_id=yg.year_id).Count().ToString() + ",";
}
res2 = res2.Substring(0, res2.Length - 1);
res2 += "]";
res2 += "},";
}
res2 = res2.Substring(0, res2.Length - 1);
res2 += "]";
return res + "*" + res2;
}
}
here year is in int
when i build error occur on this line
res2 += a.Std_info.Where(t => t.Catg_id == ct.Catg_id && t.Prog_id == pr.Prog_id && t.year_id=yg.year_id).Count().ToString() + ",";
Errors:
Cannot convert lambda expression to type 'string' because it is not a delegate type
Delegate 'System.Func<webapplication1.std_info,int,bool>' does not take 1 arguments
Operator '&&' cannot be applied to operands of type 'bool' and 'int?'