bind data in repeater using JSON gives error if record more then 500 in c# -
i want bind data database in repeater using json/jquery. when add more 600 records in table data not display. when records less 600 working.what problem don't find it.please hehp me.
<script type="text/javascript"> $(document).ready(function () { $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "webform1.aspx/binddatatble", data: "{}", datatype: "json", success: function (data) { (var = 0; < data.d.length ; i++) { $("#tbldetails").append("<tr><td>" + data.d[i].employeid + "</td><td>" + data.d[i].firstname + "</td><td>" + data.d[i].lastnname + "</td><td>" + data.d[i].salary + "</td><td>" + data.d[i].joingingdate + "</td><td>" + data.d[i].department + "</td></tr>"); } }, error: function (result) { alert("error"); } }); }); </script> [webmethod] public static list<userdetails> binddatatble() { datatable dt = new datatable(); list<userdetails> result = new list<userdetails>(); sqlconnection cn = new sqlconnection(configurationmanager.connectionstrings["con"].connectionstring); cn.open(); sqlcommand cmd = new sqlcommand("select * employee", cn); sqldataadapter da = new sqldataadapter(cmd); da.fill(dt); cn.close(); foreach (datarow dtrow in dt.rows) { userdetails user = new userdetails(); user.employeid = convert.toint32(dtrow["employeeid"].tostring()); user.firstname = dtrow["firstname"].tostring(); user.lastnname = dtrow["lastname"].tostring(); user.salary = dtrow["salary"].tostring(); user.joingingdate = dtrow["joiningdate"].tostring(); user.department = dtrow["department"].tostring(); result.add(user); } return result; } }
Comments
Post a Comment