How to add arrayList of DTO object to DataTable

How to add arrayList of DTO object to DataTable

chamathkalhara93chamathkalhara93 Posts: 1Questions: 1Answers: 0

I am new to this subject. I want to add this ArrayList of Department object to my DataTable.

Answers

  • allanallan Posts: 64,386Questions: 1Answers: 10,628 Site admin

    It would be worth reading over how to Ajax source data in .NET and also the DataTables Ajax page.

    The above code appears to be attempting to get the data from the database in C# and then just assigning it into javascript. In fact what is happening is that you are assigning $('#json') to ajax where $() returns a jQuery object.

    I'd suggest looking into Web API with .NET as that works really nicely with Ajax.

    Allan

This discussion has been closed.