We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Is DataSet and List objects act as same at run-time while filling the template?


I have a specific requirement on LINQ reporting engine, where I can execute the SQL query against data base and get the results in Dataset format. Here is the sample code I used for generating the template using dataset.

<<foreach [in ds.Person]>>
Name <<[Name]>>
Phone <<[Phone]>>
<< /foreach>>

<<foreach [in ds.City]>>
Name <<[Name]>>
Country <<[Country]>>
<< /foreach>>

But in general, List object has more advantages in C# over the Dataset, since List object has more extension methods to query the objects. But since my data is in Dataset, I even would like to use the extension methods offered by List.

For testing I tried <<[ds.Person.Count()]>> in template, It works well. So I taught Datatable is acting like a IEnumarable object. So Linq Reporting engine is considering List and Datatable in the same manner at runtime, Is that correct?

I would like to know advantages of List object over the Datatable in Linq Reporting except List object properties can hold the other collection, where datatable can’t. Sorry for lengthy explanation for small thing…


Thanks for your query. We are looking into your inquriy and will update you soon.


Any update on this? Just wondering whether Dataset is the best or List object is best? At the moment I am working with Dataset, but I would like to use all the extension methods like Count(), First(), Where(…), Skip() and predicate functions. Can I use all these extension methods on Datatable? If, so what is the advantage if I change my data source from Datatable to List?


Thanks for your patience. Please note in general there is no major difference in using regular objects/lists vs. DataTables/DataRows, Aspose.Words Reporting engine treat both as same all operations are normally supported. However, using of DataRow enables to access related rows using syntax like “Parent.Child” and DataTable enables to use grouping and sorting for its rows. Whereas objects/lists do not.