Litle Problem Help Plz

C

CorfuVBProgrammer

I have create a very simple program in my Visual Basic 2005 Pro.

I retrive some records from my database and then i have bind some text
fields to that data.

When the application starts then the text fields are showing the first
record of the table.

After that i have add a button to move the records to the next and
next and so on and on label to showing the current position.

The problem is that the label showing the new position but the text
fields are not changing the values.

Why ? ? ?

THE CODE


Public Class Form1


Private Sub CustomersBindingNavigatorSaveItem_Click(ByVal sender
As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.CustomersBindingSource.EndEdit()

Me.CustomersTableAdapter.Update(Me.NorthwindDataSet.Customers)


End Sub


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'NorthwindDataSet.Customers' table. You can move, or remove it, as
needed.
Me.CustomersTableAdapter.Fill(Me.NorthwindDataSet.Customers)
Me.Label3.Text = Me.BindingContext(Me.NorthwindDataSet,
"Customers").Position
End Sub


Private Sub CustomersBindingSource_CurrentChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CustomersBindingSource.CurrentChanged


End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Me.BindingContext(Me.NorthwindDataSet, "Customers").Position
=
Me.BindingContext(Me.NorthwindDataSet, "Customers").Position + 1
Me.BindingContext(Me.NorthwindDataSet,
"Customers").EndCurrentEdit()
Call PositionChanged()
End Sub


Private Sub PositionChanged()
Me.Label3.Text = ((Me.BindingContext(Me.NorthwindDataSet,
"Customers").Position + 1).ToString & " / " &
Me.BindingContext(Me.NorthwindDataSet, "Customers").Count.ToString)
End Sub


Private Sub CustomersBindingSource1_CurrentChanged(ByVal sender
As
System.Object, ByVal e As System.EventArgs) Handles
CustomersBindingSource1.CurrentChanged


End Sub
End Class


Thanks a lot . . .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Database Records Represantation Problem ? ? ? 1
Debugging Error 1
Mental Block 5
Anoying Problem 6
OleDbSelect Help 3
DataRow - How To? 13
help on contextmenustrip 3
Tutorial, what have I missed ? 6

Top