DB app design suggestion

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I created a drag and drop winform app in vs2008 from a single table of an
access database. I added additional queries to the data adapter in data set
designer. Two of them are for moving to next and previous records as below;

FillNext/GetDatNext

SELECT TOP 1 <field list>
FROM MyTable
WHERE (ID > ?)
ORDER BY ID


FellPrev/GetDatPrev

SELECT TOP 1 <field list>
FROM MyTable
WHERE (ID < ?)
ORDER BY ID DESC

The two commands are executed via Me.MyTableAdapter.FillPrev and
Me.MyTableAdapter.FillNext commands operated by Move Next and Move Prev
buttons on the form.

I have two questions;

1. Is this the correct approach to return only one record at a time?

2. When I press the Move Next button i.e. FillNext/GetDatNext command is
executed the record takes a couple of seconds to be returned and displayed
in the bound controls. Why is returning a single record taking so long? The
Move Prev on the other hand is fast presumably because record is already
somewhere in the buffer?

Any tips for improvements will be much appreciated.

Many Thanks

Regards
 
PS: The two commands are passed the id of the current record as parameter so
they can return the next or previous record from the one that is currently
displayed.
 
Back
Top