Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Navigation in dataset going backwards when asking to go next

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

ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial