Datareader与数据集(Datareader vs Dataset)
我有一个方法将数据库中的内容导出到excel文件。 该方法以参数形式表示DataReader参数和int参数 - 行数。 对于我正在使用数据集的行数,我使用与datareader相同的查询填充。 所以我要执行两次......有没有办法可以避免这种情况? 我可以以某种方式从datareader获取行数吗?
谢谢!
I'm having a method that exports content from the database to excel files. The method taks as paramaters a DataReader param and a int param - the number of rows. For the number of rows i'm using a dataset, wich i fill using the same query as for the datareader. So I'm executing it twice... Is there a way I can avoid that? Can I somehow get the number of rows from the datareader ?
Thanks!
原文:https://stackoverflow.com/questions/4182097
更新时间:2022-01-10 14:01