Next and Previous buttons working with unbound data?


hello.

i trying implement next , previous buttons on web page uses ce database, , having trouble getting logic figured out.  data unbound , i'm not returning @ once, paging through item @ time isn't possible.  because of high volume, thinking pass in record id each time need retrieve record , every time user hits next or previous button, i'll requery record need.  sound reasonable?

in main page, i'm using viewstate store record id need acquire.  part works--it gives me highest id number (so recent record):

        if (!ispostback) {
            // start out recent record in selected category.  gethighestconfessionid() return
            // id of recent confession.
            viewstate ["confessionid"] = mysearch.gethighestconfessionid (int.parse(viewstate["category"].tostring()));
        }


here's trouble comes in--i need go next record in database when user hits next, don't know how that.  big idea issue command in next button:

viewstate ["confessionid"] = getnextconfessionid (viewstate ["confessionid"]);


but i'm not quite sure how increment/decrement confessionid, since it's not guaranteed sequential (a record have been deleted).

if user hits next, example, need query next record id, i'm not sure how since they're not sequential.

is there simple solution?  feel i'm making mountain out of molehill.

thanks in advance ideas.

i ran across post on internet:

data adapter has feature fetch records startrecords , maxrecords parameters in fill method. use own logic fetch records page-wise using dataadapter's fill method. example of using fill method below:

int currentrecindex=15;
int pagesize=10;
dataset ds2 = new dataset();
da.fill(ds2, currentrecindex, pagesize, "table1");

at first thought might want, think experts entire set of data queried, , that's not need.  still wanted post it, in case helps understand kind of i'm trying do.


SQL Server  >  SQL Server Compact



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........