DataReader cursor rewind

后端 未结 1 415
半阙折子戏
半阙折子戏 2021-01-20 02:19

How do I can rewind a cursor of a DataReader to the beginning?

With one DataReader result I need to run two while loop, but those have to be from beginn

相关标签:
1条回答
  • 2021-01-20 03:04

    You cannot (unless you execute the command again): it is a one-way stream. If you want to see the data more than once you'll have to buffer it in memory yourself, for example in a List<T> (for some T), or (yeuch) as a DataTable.

    0 讨论(0)
提交回复
热议问题