public ActionResult GetBarChartData() { ReqList r = new ReqList(); DataSet ds = r.Get_TotalStock(); List <PoVM> list = new List <PoVM>(); foreach (DataRow dr in ds.Tables[0].Rows) { list.Add(new PoVM { ItemName = dr["ItemName"].ToString(), AvailableStock = Convert.ToInt32(dr["Availablestock"]), QualityStock = Convert.ToInt32(dr["Qualityinspectionstock"]), ReorderPoint = Convert.ToInt32(dr["ReorderPoint"]) }); } return(Json(list, JsonRequestBehavior.AllowGet)); }