I am currently working on a project that involves the use of data base sources, namely ODBC. The problem is I have designed a form using the Data Source Configuration Wizard that doesn't update. I've ensured that I have a primary key in my data and that the Copy to output is set to "Copy Always". The code generated by the wizard, is as follows:

Public Class Form1

   Private Sub GDBBindingNavigatorSaveItem_Click_
   (ByVal sender As System.Object, ByVal e As System.EventArgs)_
    Handles GDBBindingNavigatorSaveItem.Click

   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 'DataSet1.CAI' table. You can move, or remove it, as needed.

   End Sub
End Class

When this code is run the program executes in the expected manner until 'Me.TableAdapterManager.UpdateAll(Me.DataSet1)' at which point it warns of an 'InvalidOperationException was unhandled', more specifically that 'Update requires a valid UpdateCommand when passed DataRow collection with modified rows.' (This was the code the program inserted automatically and it doesn't run :'( ). I have attempted to fix the error by placing


directly above 'Me.TableAdapterManager.UpdateAll(Me.DataSet1)', which gets rid of the exception but still does not update the database. Any help would be greatly appreciated. Thanks in advance

6 Years
Discussion Span
Last Post by ericpierre
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.