public JsonResult fetchExcelData() { FetchData obj = new FetchData(); DataSet ds = obj.ReadExcelFile(); //var val = ds.Tables[0].Rows[0]["Name"]; //object op = ds; //IEnumerable<DataRow> sequence = null; //foreach (DataTable t in ds.Tables){ // sequence = t.AsEnumerable(); //} var json = new JavaScriptSerializer().Serialize(getListFromDataSet(ds)); return(Json(getListFromDataSet(ds), JsonRequestBehavior.AllowGet)); }