How to fetch data from SQL Server table to fill datatables.net grid
How to fetch data from SQL Server table to fill datatables.net grid
I am new to datatables.net and created a html page using the example http://datatables.net/examples/api/row_details.html
Most of the examples to fetch data using AJAX call is php or static data using a .txt file ....I am .NET developer with C# experience. My data is in SQL Server table and I want to fetch that data from table using AJAX call method described there..
$(document).ready(function() {
var table = $('#example').DataTable( {
"ajax": "../ajax/data/objects.txt",
"columns": [
{
"class": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{ "data": "name" },
{ "data": "position" },
{ "data": "office" },
{ "data": "salary" }
],
"order": [[1, 'asc']]
} );
Please guide how to fetch it from sqlserver using the same method or wat needs to be done to achieve this. Thanks
Answers
A forum search for C# will show several posts about this.