[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Navigation in dataset going backwards when asking to go next

Posted on 2010-03-23
1
Medium Priority
?
214 Views
Last Modified: 2012-05-09
vb.net 2003
access 2003 backend

loading the dataset via code:   no textboxes are bound...all are unbound..
Dim das1 As New System.Data.DataSet()
    Dim cnn1 As New OleDb.OleDbConnection( _
                "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                "Data Source=c:\Program Files\" & _
                "Crs_iCart\Beta_2010_Crs_iCart.mdb")
    Dim query As String = "SELECT * FROM tblMainData Order By MainTableID DESC "
    Dim dap1 As New System.Data.OleDb.OleDbDataAdapter(query, cnn1)
   
Problem:
The data loads as I ask: the Maintable id is descending.
so If I have 21 records record id "21" shows up


Weird Part:
When I press the "next" it should do nothing..
But The records go to the previous record ?
21..20..19  etc...

When I press "previous" it does nothing ?

Thanks
fordraiders





Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
        'Move to next position
        Me.BindingContext(das1, "tblMainData").Position += 1
    End Sub

Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
        'Move to previous position
        Me.BindingContext(das1, "tblMainData").Position -= 1
    End Sub

Open in new window

0
Comment
Question by:Fordraiders
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 28434615
>Dim query As String = "SELECT * FROM tblMainData Order By MainTableID DESC "

Its because you have DESC sorting applied to it. Remove DESC from the query.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses

608 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