Napivo1972 Posted September 29, 2004 Posted September 29, 2004 I have an array of OleDbDataAdapter defined like Private DataadAdaptors(MaxTables) As OleDbDataAdapter And I first defined the function to handle them like Private Shared Sub DaRowUpdated(ByVal sender As Object, ByVal e As System.Data.OleDb.OleDbRowUpdatingEventHandler) And add the handler like this AddHandler DataadAdaptors(vTable).RowUpdating, New EventHandler(AddressOf DaRowUpdating) I get the following error D:\VB .Net Project\Helpdesk3\Helpdesk3\DataBase.vb(443): Method 'Private Shared Sub DaRowUpdating(sender As Object, e As System.Data.OleDb.OleDbRowUpdatingEventHandler)' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. Looks quite easy to solve, doesn�t it? Private Shared Sub DaRowUpdating(ByVal sender As Object, ByVal e As System.EventArgs) I still use the same line to define the Handler AddHandler DataadAdaptors(vTable).RowUpdating, New EventHandler(AddressOf DaRowUpdating) But now I get this error D:\VB .Net Project\Helpdesk3\Helpdesk3\DataBase.vb(442): Value of type 'System.EventHandler' cannot be converted to 'System.Data.OleDb.OleDbRowUpdatingEventHandler'. Anyone knows how to solve this? I need to intercept the RowUpdating event! Quote
Administrators PlausiblyDamp Posted September 29, 2004 Administrators Posted September 29, 2004 Try something like Private Shared Sub DaRowUpdated(ByVal sender As Object, ByVal e As System.Data.OleDb.OleDbRowUpdatingEventHandler) 'And add the handler like this AddHandler DataadAdaptors(vTable).RowUpdating, AddressOf DaRowUpdating Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.