Merajuddin Ansari

Merajuddin Ansari

  • NA
  • 90
  • 14.7k

Handling JSON arrays returned from ASP.NET web services with

Dec 13 2017 1:03 AM
This code perfectly work for below 225 rows of records only..... how can i get the record more then 225...
 
[WebMethod]
public eval_list[] Bind_gv_eval_WM(string emp_id)
{
string lang = "eng";
if (HttpContext.Current.Request.Cookies["hrmsRiyadhFoods"]["lang"] == "Arabic")
lang = "ar";
SelectQuery sq = new SelectQuery();
SqlParameter[] param = { new SqlParameter("@emp_id", SqlDbType.VarChar, 10) { Value = emp_id} ,
new SqlParameter("@lang", SqlDbType.VarChar, 3) { Value =lang }
};
DataSet ds = sq.fnSelectQueryUsingStoredProc("Evaluation_Details", "hrms", param);
List<eval_list> list = new List<eval_list>();
foreach (DataTable table in ds.Tables)
{
foreach (DataRow row in table.Rows)
{
eval_list lst = new eval_list();
lst.date = Convert.ToString(row["Date"]);
lst.total = Convert.ToDecimal(row["Total"]);
lst.result = Convert.ToString(row["Result"]);
lst.mgr_remark = Convert.ToString(row["MGR Remark"]);
list.Add(lst);
}
}
return list.ToArray();
}
 
//javascript 
 
function Bind_gv_eval(emp_id) {
$.ajax({
type: "POST",
url: "../my_ws.asmx/Bind_gv_eval_WM",
data: '{emp_id: "' + emp_id + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
$("#tbl_eval tr").remove();
$("#tbl_eval").append("<tr><th>Date</th><th>Total</th><th>Result</th><th>MGR. Remark</th></tr>");
if (data.d.length > 0) {
for (var i = 0; i < data.d.length; i++) {
$("#tbl_eval").append("<tr><td>" + data.d[i].date + "</td><td>" + data.d[i].total + "</td><td>" + data.d[i].result + "</td><td>" + data.d[i].mgr_remark + "</td></tr>");
}
}
else {
$("#tbl_eval").append("<tr><td colspan=" + 4 + ">No previous evaluation record found</th></tr>");
}
},
failure: function (result) {
alert(result.d);
}
});
}
 

Answers (2)