Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Gentlemen,

Need some help with a college project which is not working as i am naive to it, perhaps my coding done is incorrect which as given below.
Request your expert help if someone knows the subject.

Thankyou in anticipation.
Kind Regards


I have (4) tables made under a single (customer.mdf) file running in VB10 under SQL Server Database file. (Table1,Table2,Table3,Table4)
If we run the project it does not update and save records.

However only The first two tables get updated and saved after using the following code.

VB
Public Class Form1
  Private Sub Table1BindingNavigatorSaveItem_Click(ByVal  sender.........
  Me.Validate()
  Me.Table1BindingSource.EndEdit()
  Me.TableAdaptorManager.UpdateAll(Me.CustomerDataSet)

  Me.Table2BindingSource.EndEdit()
  Me.Table2TableAdaptor.Update(Me.CustomerDataSet)

End Sub



But if we use the following code to include (4) tables as below it does not work and gives error.



VB
Me.Validate()
  Me.Table1BindingSource.EndEdit()
  Me.TableAdaptorManager.updateAll(Me.CustomerDataSet)

  Me.Table2BindingSource.EndEdit()
  Me.Table2TableAdaptor.update(Me.CustomerDataSet)

  Me.Table3BindingSource.EndEdit()
  Me.Table3TableAdaptor.update(Me.CustomerDataSet)

  Me.Table4BindingSource.EndEdit()
  Me.Table4TableAdaptor.update(Me.CustomerDataSet)

End Sub
Posted
Updated 7-Sep-14 1:13am
v2
Comments
Richard MacCutchan 7-Sep-14 6:50am    
Please explain what error, we cannot guess what it is.
olly2014 7-Sep-14 7:08am    
It Does not save it saves only the 1 & 2 table
[no name] 7-Sep-14 7:48am    
That is when you run your code in the debugger and add some error handling code to find out what exceptions are being generated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900