besmart2000
Active member
- Joined
- Feb 18, 2007
- Messages
- 25
- Programming Experience
- 1-3
Hi all
I created baseForm that contain a BindingNavigator only
I want to write a common SAVE Click event to be shared for all forms that inherit from BaseForm.
Commonly, the generated code is like:
Private Sub CategoriesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CategoriesBindingNavigatorSaveItem.Click
Me.Validate()
Me.CategoriesBindingSource.EndEdit()
Me.CategoriesTableAdapter.Update(Me.NorthwindDataSet.Categories)
End Sub
The problem is CategoriesTableAdapter which is generated for every form and it is System.ComponentModel.Component and table dependent.
I want to cenenteralize the Save Code in the BaseForm.
How Can I implement The Save Code using BindingSource Control which can be passed as a parameter, without using CategoriesTableAdapter (i.e to be Table independent)
thanks
I created baseForm that contain a BindingNavigator only
I want to write a common SAVE Click event to be shared for all forms that inherit from BaseForm.
Commonly, the generated code is like:
Private Sub CategoriesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CategoriesBindingNavigatorSaveItem.Click
Me.Validate()
Me.CategoriesBindingSource.EndEdit()
Me.CategoriesTableAdapter.Update(Me.NorthwindDataSet.Categories)
End Sub
The problem is CategoriesTableAdapter which is generated for every form and it is System.ComponentModel.Component and table dependent.
I want to cenenteralize the Save Code in the BaseForm.
How Can I implement The Save Code using BindingSource Control which can be passed as a parameter, without using CategoriesTableAdapter (i.e to be Table independent)
thanks