Greetings,
I have used the .NET 2003 "Add Inherited Form" "Data form wizard" to create a form which uses two tables from an Access 2000 database. The tables are relational in nature with a 1 to many relationship. The wizard creates the form with no issues and loads the data accordingly however when I attempt an update I receive the message provided in the subject line above.
I have seen another thread on this forum with this same message however I believe that my approach is a bit differenct than the gentleman in the other thread.
I have re-created this form using two tables, a table and a query, and a query, in every instance I receive the same message.
The following represents the update code for this particular form:
Public Sub UpdateDataSet()
Create a new dataset to hold the changes that have been made to the main dataset.
Dim objDataSetChanges As SoundFX.dstButtonTemplate = New SoundFX.dstButtonTemplate
Stop any current edits.
Me.BindingContext(objdstButtonTemplate, "Button Template Table").EndCurrentEdit()
Me.BindingContext(objdstButtonTemplate, "Button Assignment Table").EndCurrentEdit()
Get the changes that have been made to the main dataset.
objDataSetChanges = CType(objdstButtonTemplate.GetChanges, SoundFX.dstButtonTemplate)
Check to see if any changes have been made.
If (Not (objDataSetChanges) Is Nothing) Then
Try
There are changes that need to be made, so attempt to update the datasource by
calling the update method and passing the dataset and any parameters.
Me.UpdateDataSource(objDataSetChanges)
objdstButtonTemplate.Merge(objDataSetChanges)
objdstButtonTemplate.AcceptChanges()
Catch eUpdate As System.Exception
Add your error handling code here.
Throw eUpdate
End Try
Add your code to check the returned dataset for any errors that may have been
pushed into the row objects error.
End If
End Sub
I am pariculary confused as there has been no alteration in every method tried to the actual code generated by the Wizard.
I have used the .NET 2003 "Add Inherited Form" "Data form wizard" to create a form which uses two tables from an Access 2000 database. The tables are relational in nature with a 1 to many relationship. The wizard creates the form with no issues and loads the data accordingly however when I attempt an update I receive the message provided in the subject line above.
I have seen another thread on this forum with this same message however I believe that my approach is a bit differenct than the gentleman in the other thread.
I have re-created this form using two tables, a table and a query, and a query, in every instance I receive the same message.
The following represents the update code for this particular form:
Public Sub UpdateDataSet()
Create a new dataset to hold the changes that have been made to the main dataset.
Dim objDataSetChanges As SoundFX.dstButtonTemplate = New SoundFX.dstButtonTemplate
Stop any current edits.
Me.BindingContext(objdstButtonTemplate, "Button Template Table").EndCurrentEdit()
Me.BindingContext(objdstButtonTemplate, "Button Assignment Table").EndCurrentEdit()
Get the changes that have been made to the main dataset.
objDataSetChanges = CType(objdstButtonTemplate.GetChanges, SoundFX.dstButtonTemplate)
Check to see if any changes have been made.
If (Not (objDataSetChanges) Is Nothing) Then
Try
There are changes that need to be made, so attempt to update the datasource by
calling the update method and passing the dataset and any parameters.
Me.UpdateDataSource(objDataSetChanges)
objdstButtonTemplate.Merge(objDataSetChanges)
objdstButtonTemplate.AcceptChanges()
Catch eUpdate As System.Exception
Add your error handling code here.
Throw eUpdate
End Try
Add your code to check the returned dataset for any errors that may have been
pushed into the row objects error.
End If
End Sub
I am pariculary confused as there has been no alteration in every method tried to the actual code generated by the Wizard.