'Exporting SQL data to Excel in ASP.net MVC

I am trying to follow this demo (2nd method) to make sure it works before using it in a bigger project.

https://www.yogihosting.com/export-excel-asp-net-mvc/

However I keep getting an error when retrieving my data at the following line below:

DataSet dataSet = GetRecordsFromDatabase();

System.Collections.Generic.List<**********>' to 'System.Data.DataSet

I have a local SQL database connected to my project but I cannot seem to import the data as a DataSet type. Is it possible to hard code a mock Dataset locally for testing or is there an easier way to retrieve the data from my own local SQL server?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source