Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do I move thru records in a Dataset?

Posted on 2005-03-28
3
Medium Priority
?
152 Views
Last Modified: 2010-04-23
Do I have any movenext or go to top bottom,etc?
0
Comment
Question by:Mylor
3 Comments
 
LVL 34

Expert Comment

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

Expert Comment

by:Dabas
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
Next

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

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



Dabas
0
 
LVL 2

Accepted Solution

by:
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
        DisplayPosition()
    End Sub
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

580 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