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

JosephRockHeartJosephRockHeart Posts: 1Questions: 1Answers: 0

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

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    A forum search for C# will show several posts about this.

This discussion has been closed.