Is there any lazy DataAdapter in nature that pulls records into the DataSet as they are needed or N records at a time?

Sometimes it is not rational to load all data into memory due to its large volume and you want to perform updates by a few, return the data back to the server and take the next batch.

Is there anything ready?

Of course, it is possible to realize with handles, but perhaps something has already been invented before me and you do not need to make a bicycle?

  • one
    Perhaps this is stackoverflow.com/questions/21937548/… line da.Fill (ds, 1, maxRowCount, ds.Tables [0] .TableName); - NMD
  • @NMD is like what you need. It turns out that you still have to lay some kind of logic to pull new records every time. Is it possible to pull up all the dependent records of other tables automatically as separate tables in Damaskin? - iluxa1810 pm

1 answer 1

Use Hibernate for such purposes. There are a lot of manuals, but the idea is that you specify setFirstResult and setMaxResults , where you specify intervals.

 public List<Cat> findCats(String name, int offset, int limit) { Query q = session.createQuery("from Cat where name=:name"); q.setString("name", name); if (offset > 0) { q.setFirstResult(offset); } if (limit > 0) { q.setMaxResults(limit); } return q.list(); } 

There is a ready-made solution already in this issue.

  • Hibernate, as far as I know, is it ORM? And I can push data back without problems? With Access Database, he is friends? - iluxa1810
  • @ iluxa1810 yes, this is ORM. Hibernate allows you to push data where you want, you can even first type in the data in the cache, and then write to the database. Here's an example on ms Access. Stackoverflow.com/questions/550948/… - Senior Pomidor
  • Link something is not working. - iluxa1810
  • @ iluxa1810 I apologize. here is programmingforfuture.com/2011/06/… - Senior Pomidor