SqlDataReader does not return all records (3rd attempt)

后端 未结 2 931
南方客
南方客 2021-01-22 01:55

I\'ve tried to find solution for this problem twice before, but unfortunately those answers haven\'t provided permanent fix, so here I am, giving it another try.

I have

2条回答
  •  萌比男神i
    2021-01-22 02:21

    Basically you read all record in SqlDataReader with select query I suggest you to add order by in your query and it sort all records in Acceding order and they also read in acceding order in SqlDataReader.

    I also face this problem in my last project I have read more than 2 million records from database with unique id serialNo but this records are not come in sequence after 1000 records it jumps to 21, 00, 263th record and all records are come in wrong sequence.

    Then I use (order by serialNo) this query and my problem is solved you not need to do anything extra only put order by in your select query and it will work for you

    I hope this helps for you.

提交回复
热议问题