473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Database Records Represantation Problem ? ? ?

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.NorthwindDataSe t.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

Mar 15 '07 #1
1 963
You don't need to post your questions more than once. :-)
Robin S.
---------------------------
"CorfuVBProgrammer" <me***********@gmail.comwrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
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.NorthwindDataSe t.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

Mar 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andante.in.Blue | last post by:
Hello everyone! I've been working with a problematic legacy database for a while. While I am still fairly new to Access, the more I work with the database, the more problems I've uncovered. ...
7
by: Danny J. Lesandrini | last post by:
I know this has been discussed before, as I've seen the Google posts, but they all leave me with an unanswered question: Does my DAO code executed in the front end cause the back end to bloat?...
1
by: Bridget Willey | last post by:
I am using ACT 6 and am trying to "split" the database between records for customers and junk records. The accounts designated as "customers" have that word in the ID field, and I am using that...
16
by: John | last post by:
Hi All, I have two backend databases that area link to a frontend database where information is entered, retrieved and deleted. The information accessed from the frontend database is coming from...
7
by: PC Datasheet | last post by:
Looking for suggestions ---- A database was designed for a national automobile inspection program. In it's simplest form, the database has two tables: TblOwner OwnerID <Year/Make/Model owned...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
7
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
1
by: dheroan | last post by:
Hi there, I'm fairly new to using databases with VB .NET. I'm currently working on an application using a Microsoft Access database as a data source. I have created a form to display the fields...
2
by: tamaker | last post by:
Is this do-able with ASP / VBscript? -- I have a database with user records (name, photo, etc. etc.) I want to use asp to generate (on the homepage) a series of 4 randomly selected 'user...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.