Search  


Q&A: DataTable vs DataSet 
Tuesday, April 21, 2020, 10:53 PM
Posted by Administrator
Q: I currently use a DataTable to get results from a database which I can use in my code.

However, many example on the web show using a DataSet instead and accessing the table(s) through the collections method.

Is there any advantage, performance wise or otherwise, of using DataSets or DataTables as a storage method for SQL results?

A: It really depends on the sort of data you're bringing back. Since a DataSet is (in effect) just a collection of DataTable objects, you can return multiple distinct sets of data into a single, and therefore more manageable, object.

Performance-wise, you're more likely to get inefficiency from unoptimized queries than from the "wrong" choice of .NET construct. At least, that's been my experience.
2 comments ( 88 views )   |  permalink   |  $star_image$star_image$star_image$star_image$star_image ( 3.1 / 420 )

<<First <Back | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | Next> Last>>







Share CertificationPoint & Stay Informed Socially About EduTech?