jQuery datatables get data from database table

kudvenkat · 285K views · 2015 · 21:04

Open on YouTube

Web developmentDatabases & storagetutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about getting database data into jQuery DataTables, especially in ASP.NET projects.

Recommended by 2 people across 2 different months, 2015 to 2017.

What it is

A tutorial by kudvenkat showing how to load data from a SQL database table (tblEmployee) into the jQuery DataTables plugin in an ASP.NET app. It covers retrieving all data at once so that paging, searching and ordering run client-side, and contrasts this with server-side processing for large tables.

What people said

Recommends Offir · 2016-10 · Stack Overflow · on “Datatables headers disappear after adding scrolling”

You don't show how you do it, so watch this video and I believe it will solve you your problem.https: [this video]

Recommends Ashiquzzaman · 2017-05 · Stack Overflow · on “unable to fetch data from DB using ajax”

You use [HttpGet] in your action , means only allow http GET request in your action. But your ajax call you use POST request . That's not accept in your action. so change POST to GET if you need GET request OR change [HttpGet] to [HttpPost] for POST request . You do't need multiple ajax call.so need to change your ajax call because jquery datatable has own ajax call for data loading. you can fiend your answer this [LINK] or this [LINK] link. Or you can follow this [this video] YouTube video.

Cites Abhishek Ghosh · 2015-08 · Stack Overflow · on “jQuery DataTable JS not working(ASP .NET 3-tier architecture)”

I believe there is ufcourse some way other than I am mentioning in my answer to use the jQuery DataTable in your ASP.NET web-application. But I found this the easiest way possible. Step-1) Create a web service in your website.In the code below I am converting a datatable returned from my query result into a JSON Array with one of the utilities I found on the internet. Here is the code for the WebService : /// <summary> /// Summary description for ProductDetailsWebService /// </summary> [WebService(Namespace = " [LINK] ")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NE

Cites Jim Lobo · 2016-10 · Stack Overflow · on “JQuery DataTable1.10.2 white space Issue While Filtering Column Values”

Hi markpsmith . I am using [this video] to retrieve columns from database also there is another link thinking of using stored procedure for paging sorting and searching [LINK] Is this the right way or do we have to use datatables API . Please advise me on this

Cites Mahantesh · 2017-08 · Stack Overflow · on “How to reduce codeigniter view loading time”

Yes to improve performance I used DataTable plugin of jquery with ajax and generated table data using columndef attribute of datatable. Here is link of youtube [this video]