BindingNavigator update 2

Joejoe79sa

Member
Joined
Mar 24, 2007
Messages
7
Programming Experience
Beginner
Ok so i asked about the binding navigator before and i sorted it out by using this code to save my new records.
VB.NET:
Try
Me.StudentBindingSource.EndEdit()
Me.StudentTableAdapter.Update(Me.StudantDataSet.Student)
MsgBox("Update Successfull", MsgBoxStyle.OkOnly)
Catch ex As Exception
MsgBox("Update Failed", MsgBoxStyle.Critical)
End Try
Now i i dont know how to commit changes made to current records. For instance say i want to change the client idnr. I retype the IDnr but how do i commit the changes to the database? Thanks for the help guys...
Later
 
Last edited by a moderator:
Re: "BindingNavigator Update"

BindingNavigators do NOT update anything..

Here's a quick breakdown:

A DataSet is a collection of DataTable
A DataTable is a collection of DataRow
A DataRow is a collection of data elements
A TableAdapter is a device that uses a hidden DataReader to fill a DataTable with DataRows from a data source such as a database, and send updates (changes to the DataRows) back to the data source
TableAdapters do not fill DataSets. DataSets do not hold data directly.
In .NET 2.0 controls are usually bound to data through a BindingSource
A BindingSource sits on top of a block of data (such as a DataTable) and maintains knowledge of position; changing the .Position of a BindingSource changes what row of data all controls that bind through that BindingSource, are looking at
BindingSources can also filter and sort the rows they present, independently of the DataTable or DataRelation upon which they are based
A DataRelation acts as a filter device to only show records from a child data source (usually a DataTable) whose foreign key matches the primary key of the current row of the relation's parent table. Because the concept of "Current Parent Row" is needed for a DataRelation to work, they are usually found within BindingSources; the Parent BindingSource exposes all the DataRelations whose parent table is the the table upon which the BindingSource sits. Any databound entity (usually a BindingSource) bound to the DataRelation, only receives a filtered set of rows from the child data source, dependent on which parent row the Parent BindingSource is positioned at
A BindingNavigator is a device that alters the position of a BindingSource through use of its [|<], [<], [>] and [>|] buttons, and can be used to invoke common actions on the BindingSource, such as .AddNew(), .Delete() and .Update()
 
BindingNav

ARG this is the code i have been using but it does not update the records.

Me.StudentTableAdapter.Update(Me.StudantDataSet.Student)

Any idea why?

Thanks for the help guys, i work on very minimal resources to ehlp me study so any help i really appreciate
 
Back
Top