Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试使用 VB.NET 将数据填充到 FlexGrid 中时,DataTable 和 SqlDataReader 之间哪个更快?
SqlDataReader 更快,因为它是只读转发的。但是 DataTable 是基于 xml 的,速度较慢。
取决于您要做什么,如果您只需要获取 x 行,那么 Reader 会更快,但如果您要操作或想要对结果集使用缓存,则选择任何类型的数据收集。
SqlDataReader 要快得多。它是只读的,您只能在其上向前运行。
我一直使用阅读器,除非是紧急情况...