Avatar of Larry Brister
Larry Brister
Flag for United States of America asked on

Dataset "next" record

I have a class that is returning a dataset that I am binding to a repeater fine.
I have a link on the repeater where I can look at the detail on the record.
]
However...
My customer wants a "Next" link on the detail page so that they can look at the detail of whatever the "Next" record is in the Repeater.

Any ideas?
repeater being filled from code below...
Private Sub loadText(ByVal _state As String, ByVal _cat As String)
        Dim getProfessional As New professionals
        Using ds As dsProfessionals = getProfessional.SearchProfessional("0", _cat, _state)
            Session("ds") = ds
            RepeaterMain.DataSource = ds
            RepeaterMain.DataBind()
        End Using
    End Sub

Open in new window

ASP.NETMicrosoft Development.NET Programming

Avatar of undefined
Last Comment
Larry Brister

8/22/2022 - Mon
Alan Warren

Hi lrbrister,

A Repeater control usually shows (repeats) all records in the dataset by default, so I suspect your dataset is limiting the resultset somehow.
I am unsure what the parameters are in the following line, but the "0" param looks like a zero based index, so perhaps some code on a hyperlink of linkbutton control event that re binds the datasource, incrementing the index, similar to what you are now doing with your sub loadText()

Private Sub loadText(ByVal _state As String, ByVal _cat As String, ByVal intPage as Integer)
        Dim getProfessional As New professionals
        Using ds As dsProfessionals = getProfessional.SearchProfessional(intPage, _cat, _state)
            Session("ds") = ds
            RepeaterMain.DataSource = ds
            RepeaterMain.DataBind()
        End Using
    End Sub

Lan ";0)
Larry Brister

ASKER
alanwarren:
I modified the dataset so the the stored procedure is puling the rowcount and I'm incluring that in the dataset and adding it as pary of the hyperlink querystring on the link going to the the detail page. (professionalProfile.aspx)See code below

SO.....
If I save the original dataset as a session variable, it seems to me that there should be some way to
to query the dataset and get the professionalID where rn = rn(querystring)+1

All I need is the professionalID where rn = the hyperlink rn+1
<a href="professionalProfile.aspx?id=<%#Container.DataItem("professionalID")%>&rn=<%#Container.DataItem("rn")%>"

Open in new window

ASKER CERTIFIED SOLUTION
Alan Warren

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Larry Brister

ASKER
That giot me started.  Watch for followup query on dataset
Your help has saved me hundreds of hours of internet surfing.
fblack61