0

I just want to know,

  1. Is there any size limit of SQLiteDataReader for holding records that mapped from Database?

  2. Is there any difference between SQLiteDataReader and SqlDataReader about size limit for holding records?

Thanks in advance.

Rezoan
  • 1,745
  • 22
  • 51

1 Answers1

2

Logically, a data reader is like a forward-only cursor - it fetches data from the database when it needs to, and yields data for one result at a time. Implementations may well fetch batches of results at a time, but that's largely hidden from clients: you see one result at a time, and you should be able to stream through very large data sets, without ever actually having very much data in memory on the client at any one time.

(Realistically, I'd suggest that it's usually not a great idea to stream billions of rows in a single query, but it depends on your context.)

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • Jon thanks for your valuable suggestion. i dont want to stream billions of row in a single query. just the question is running on my head. but recently i have to done a work "getting all data from database contains billions of records of same type and process them". which means i can read them with a single query. – Rezoan Jun 25 '13 at 15:07
  • Jon Could you please just tell me is there any possiblity to crash a datareader while featching billions of data (if all data are valid) – Rezoan Jun 25 '13 at 15:11
  • 1
    @Rezoan: If the reader has been implemented correctly, and there aren't other factors involved (such as the connection dying) it should be fine. – Jon Skeet Jun 25 '13 at 15:13