请问为OracleDataAdapter添加的事件为何无响应?
myDAP = New OracleDataAdapter(sSql, CN)
myDataSet = New DataSet()
AddHandler myDAP.RowUpdating, New OracleRowUpdatingEventHandler(AddressOf OnRowUpdating)
AddHandler myDAP.RowUpdated, New OracleRowUpdatedEventHandler(AddressOf OnRowUpdated)
myDAP.Update(myDataSet, "S")
RemoveHandler myDAP.RowUpdating, New OracleRowUpdatingEventHandler(AddressOf OnRowUpdating)
RemoveHandler myDAP.RowUpdated, New OracleRowUpdatedEventHandler(AddressOf OnRowUpdated)
Sub OnRowUpdated(ByVal sender As Object, ByVal args As OracleRowUpdatedEventArgs)
'这是更新状态(本记录是否成功)
frmMain1.ToolStripProgressBar1.Visible = True
Debug.Print(args.RowCount)
If args.Status = UpdateStatus.ErrorsOccurred Then
args.Row.RowError = args.Errors.Message
args.Status = UpdateStatus.SkipCurrentRow
End If
End Sub
Sub OnRowUpdating(ByVal sender As Object, ByVal args As OracleRowUpdatingEventArgs)
frmMain1.ToolStripProgressBar1.Visible = True
'Me.CurNum = Me.CurNum + 1
If Not (frmMain1 Is Nothing) Then 'Z是一个窗体的实例
frmMain1.ToolStripProgressBar1.Value = frmMain1.ToolStripProgressBar1.Value + 1
End If
End Sub
------最佳解决方案--------------------完全不知道什么意思。。。