Datatable vs Dataset

后端 未结 7 2083
失恋的感觉
失恋的感觉 2020-11-29 20:02

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 th

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 20:49

    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.

提交回复
热议问题