Not able to get data from the database: 500 Internal Server Error
Not able to get data from the database: 500 Internal Server Error
I am not able to pull data from the SQL database when I use the following code.
<
script>
var Popup, dataTable;
$(document).ready(function () {
dataTable = $('#MTRTable').DataTable({
"ajax": {
"url": "/Tag/GetData",
"type": "GET",
"datatype": "json"
},
"columns": [
{ "data": "Tag" },
{ "data": "Service Description" },
{ "data": "Drawing" },
{ "data": "Tag Type" },
],
"language": {
"emptyTable": "No data found, Please check the data sources"
}
});
});
I am new to coding. Any help is appreciated
Answers
That error comes from your server. You will need to look at your server logs to see why the server is returning the 500 Internal Server error.
Kevin
Kevin,
Thank you for the response.
It appears that I have more than 20K rows in the SQL database that the code is trying to convert and present. The app I am developing is to manage large data. around 100K + rows. Any recommendation on how to query the large data without getting 500 errors?
I am currently using this code to get 2000 records but it won't meet the requirement.
}
It's working now. Not sure what I did but I bumped the limit to 100K and I am still getting the results. But getting other errors.
DataTables warning: table id=MTRTable - Requested unknown parameter 'Service Description' for row 0, column 1. For more information about this error, please see http://datatables.net/tn/4
The service description property in the source table has data.
Thanks.
Did you follow the troubleshooting steps listed in the technote http://datatables.net/tn/4 ?
What is in your JSON response?
Do you have an object property named
Service Description
?Is your JSON response contained in a
data
propery?Maybe you can post a screenshot with the first row expanded.
Take a look at the Ajax docs to make sure your response matches a Datatables supported structure.
Kevin