Whilst one can subscribe to the tableadapters underlying adapter in the tableadapter partial class I find you cannot easily initialise it without having to remember to call an initialisation of your own.However I found that I can subscribe to a tableadapters.adapter.rowupdated event directly from within code using the tableadpater as below entry?Otherwise, it works fine, and now I have provider-independent event handlers available from the Db Data Adapter class (which is how Microsoft should have implemented them to begin with). ''' Public Delegate Sub Row Updating Event Handler(sender As Object, e As Row Updating Event Args) Public Module Db Data Adapter Extension Sub New() End Sub Private Function Get Event(event Name As String, type As Type) As Event Info Return type.
However, in some cases, the application or the user needs to know the IDENTITY column's assigned value as soon as you add the row to the database.
If you're creating the adapter explicitly in your code, just add the call yourself. On Row Updated); However I would prefer to do this in the adapter's partial class so that the users of the dataset don't have to remember to add this code every time they create an instance of the adapter. v=14625 if you look at this video you can see, that you just double click on something in the dataset designer and the event gets generated and wired up for you...this works only for VB programmers :)) sux The Table Adapter class does not let you override End Init (no suitable method found to override).
Alternatively, does your partial class have a constructor which is being called? EDIT: Okay, so presumably this is being used in a particular page or form - can you add it after the I am using the designer to create a typed dataset with a data table and table adapter. The Data Table partial class does allow you to override End Init however I can't see how to access the related Table Adapter from the Data Table.// Assumes that connection is a valid Sql Connection object. Row Updating -= new Sql Row Updating Event Handler(On Row Updating); cust Adapter.
Method)) End If Return True Catch End Try End If Return False End Function ''' Public Function Add Row Updating Handler(adapter As Db Data Adapter, handler As Row Updating Event Handler) As Boolean Dim upd Event As Event Info = Get Event("Row Updating", adapter.[Get Type]()) If upd Event Is Not Nothing Then Try If handler.
I am posting this question after reading other similar questions about my problem but not really understanding how I can use the information.