How do I move thru records in a Dataset?

Posted on 2005-03-28
Medium Priority
Last Modified: 2010-04-23
Do I have any movenext or go to top bottom,etc?
Question by:Mylor
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 34

Expert Comment

by:Brian Crowe
ID: 13646516
you can using the currencymanager.position property.  Can't offer much more without more details
LVL 27

Expert Comment

ID: 13646552
Hi Mylor:
You use a DataRow object to move through the rows of a table within the DataSet

Something like this, assuming ds is the variable that holds your DataSet

For each dr in ds.Tables(0).Rows
    ...do something with the datarow

If you want to go to the top of the table, use

Dim dr as DataRow = ds.Tables(0).Rows(0)


Accepted Solution

jordi169 earned 750 total points
ID: 13662126
I'm guessing you want to move from item to item in the dataset.  I've done this by binding data to textboxes and using the buttons listed in the code below.  Hope this helps.  Question is kind of vague so let us know what you think

Private Sub NavigationButtons_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click, btnLast.Click, btnNext.Click, btnPrevious.Click
        Select Case sender.Name
            Case "btnFirst"
                isLoading = True
                bmbCategory.Position = 0
                isLoading = False
            Case "btnPrevious"
                isLoading = True
                bmbCategory.Position -= 1
                isLoading = False
            Case "btnNext"
                isLoading = True
                bmbCategory.Position += 1
                isLoading = False
            Case "btnLast"
                isLoading = True
                bmbCategory.Position = bmbCategory.Count - 1
                isLoading = False
        End Select
    End Sub

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question