Database Records Represantation Problem ? ? ?

C

CorfuVBProgrammer

Hello all . . .


I'm using the Microsoft Visual Studio 2005 Pro.

I have create an application (my first one) and i connected to
Northwind database thru MS SQL Server.

Then i used some text fields to my form and i was bind some fields to
them from the database.

When the application starts everythink look ok.

In my next step i put a button to move to the next record.

I start again the application and i try to use the button but nothing
hapens . . .

The only change is the posiion of the "header" in the database. I use
the Label3 to desplay the header position.

Why ? ? ?



THIS IS THE CODE OF MY FORM

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 . . . :D
 

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

Litle Problem Help Plz 2
Debugging Error 1
Mental Block 5
Anoying Problem 6
OleDbSelect Help 3
DataRow - How To? 13
Loop not behaving as expected 13
help on contextmenustrip 3

Top