Lazy loading child data RRS feed

  • Question

  • I have a parent child database that has large images in the child rows. In a standard visual studio constructed database I have the Binding Navigator control and I want to just load and bind the child data as they scroll through the parent rows. What is the best practice to do so.

    I thought there would be an easy way just to do it in the BindingSource.PositionChanged event and change the TableAdapter to do so, but the lack of finding any examples of this makes me think I'm wrong. Maybe I'm using the wrong terminology and why I'm not finding the examples. Maybe there is a better way?

    Wednesday, June 24, 2009 4:31 PM


All replies

  • You are referring to "progressive fetching" or "fetch as needed" that is supported in other platforms. I know of no "easy" was to do this without writing your own "fetching" logic.
    Wednesday, June 24, 2009 4:54 PM
  • Is there an example or best practice to do  "progressive fetching" with datasets/TableAdapter and the ui generated database stuff?

    Would I want to just fill the TableAdapter with the single row each time? Would it be a partial class somewhere with a new method?

    What is the quickest easiest way that has been done before?


    Wednesday, June 24, 2009 5:52 PM
  • One way to do this would be to have your initial dataset/table populated based on some filtering criteria. Create an object that responds to events in your grid or whatever display object you use ( actually your datasource record pointer )  and depending on what thresholds you require use those events to  spin off a BackgroundWorker object that populates another dataset/table behind the scenes with updated filters and use that to bind to when necessary. Rinse. Repeat...
    Wednesday, June 24, 2009 6:23 PM
  • So I suspect there isn't a trivial or non trival example of this anywhere that someone knows about?

    Wednesday, June 24, 2009 7:13 PM
  • Others may have to chime in, I haven't seen one...
    Wednesday, June 24, 2009 7:14 PM
  • I have posted the idea of a paging solution for people that use Sql Server 2005. Its posted here


    Review this and see if it helps

    Chris Robinson
    Program Manager - DataSet
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, June 26, 2009 2:50 PM