Binding Problem (only binds upto 3 record forward or 26 back)

Cr@iG

New member
Joined
Nov 10, 2009
Messages
3
Programming Experience
3-5
Hi,

i am fairly new to VB.Net programming having been a VB6 developer for years (the copmany i used to work form maintained VB6 apps)?

I am writing a new application. I have created my form, databindings to the fields and everything works ok.

In order to filter through the dataset i have decided to use BindingContexManager. I have tried currency manager also.

The problem i am incurring is that when i click button next it goes forward 3 records then loops back to the first record again. If i skip to the end of the dataset i can browse back 26 records before it loops back ot the first record and gets stuck in a loop.

I know for a fact that 11000 records are returned???

VB.NET:
 'Check if the Members Table already exists and remove
        If Not MembersDataset.Tables("Members") Is Nothing Then MembersDataset.Tables.Remove("Members")
        MembersDataAdapter.SelectCommand = New OleDbCommand("SELECT * FROM MEMBERS ORDER BY MEMBERS.MEMBER_NO ASC", MainForm.oConn)

        'Add Table And Fill with Data
        MembersDataset.Tables.Add("Members")
        MembersDataAdapter.Fill(MembersDataset, "Members")

        ' Create the Binding Manager
MembersBinder = Me.BindingContext(MembersDataset, "Members")



    Private Sub FirstRecordCmd(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Me.MembersBinder.Position = 0

    End Sub


    Private Sub PreviousRecordCmd(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Me.MembersBinder.Position = Me.MembersBinder.Position - 1

    End Sub


    Private Sub RemoveFilterCmd(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub


    Private Sub NextRecordCmd(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Me.MembersBinder.Position = Me.MembersBinder.Position + 1

    End Sub


    Private Sub LastRecordCmd(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LastRecord.Click

        Me.MembersBinder.Position = Me.MembersBinder.Count - 1


    End Sub
 
Hi,

I've changed from using bindingcontexmanager to using binding source ar per help received in another forum.

This hasn't helped.

I then changed from using oledb on access to an odbc mysql database and still have the problem.

when using the bindingsource.movenext command

the records go record 1, 2 ,3, 4 then back to 1 again 2, 3 ,4 and continues this loop???

This is causeing me great pain!!! if anyoen can help i'd appreciate it!
 
in the immediate window (while stopped on a breakpoint close by) type this:

?bindingcourse.List.Count
?bindingsource.DataSource.Rows.Count

It really has 11 K rows?
 
Solved

Yeah, it really did have 11000 rows!!!

I narrowed the prblem down to an error in the build of the C1Ribbon Component i was using ont he form causing an unhandled error in the binding source.

All solved now tho
 

Latest posts

Back
Top