update problem

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 6
Reputation: haringmunti is an unknown quantity at this point 
Solved Threads: 0
haringmunti haringmunti is offline Offline
Newbie Poster

update problem

 
0
  #1
Jun 22nd, 2008
hi,

im tinkering with vb.net 2008. Im trying to add two numbers then saving it to the table. The computation works but when I press the save button, i get this..

" invalidoperationexception was unhandled " at Me.TableAdapterManager.UpdateAll(Me.Computation_database_sampleDataSet)

can someone help me with this? if i learn how to fix this, i can make other programs. attached below is the code and thanks in advance for your help.

Public Class Form1

Private Sub NumbersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.NumbersBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Computation_database_sampleDataSet)

End Sub


Private Sub NumbersBindingNavigatorSaveItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumbersBindingNavigatorSaveItem.Click
Me.Validate()
Me.NumbersBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Computation_database_sampleDataSet)

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 'Computation_database_sampleDataSet.Numbers' table. You can move, or remove it, as needed.
Me.NumbersTableAdapter.Fill(Me.Computation_database_sampleDataSet.Numbers)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n1, n2, sum As Integer
n1 = Val(EnterFirstNumberTextBox.Text)
n2 = Val(EnterSecondNumberTextBox.Text)
sum = n1 + n2
TotalTextBox.Text = sum

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
EnterFirstNumberTextBox.Text = ""
EnterSecondNumberTextBox.Text = ""
TotalTextBox.Text = ""
EnterFirstNumberTextBox.Focus()

End Sub
End Class
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC