TableAdapter won't update
Posted on 2012-09-20
I have a VB.Net 4.0 project in VS 2010
I have a data connection using the Database Explorer, connecting to an Access 2003 database
I have a query or "View" I added as a datagrid to my form. The query contains a join.
I have two problems:
Originally the BindingNavigator that also was added to the form, had the "save" feature disabled. I then enabled it, and added the following code:
Private Sub NoBannersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
This code never triggers when the button is clicked. The code is inside the Form.vb module. How do you properly reference this button?
To get around the button problem, I just added a button to the form and put the update code in that, but my table adapter update method triggers an error
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button3.Click
'Save grid edits
Me.TableAdapterManager.UpdateAll(Me.AutomationDataSet) 'Error line
TableAdapterManager contains no connection information. Set each TableAdapterManager TableAdapter property to a valid TableAdapter instance.
Another work around would be how to issue a SQL update command like DoCmd.runSQL for VB.net 4.0? Do I need to add a reference, or what is the 4.0 syntax?
Thanks in advance!