This is a migrated thread and some comments may be shown as answers.

Problems with Exception handling

1 Answer 152 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 09 Aug 2012, 12:50 PM
Occasionally my report generates an exception which I wish to catch and handle in my web page.
I had a look at the post : http://www.telerik.com/community/forums/reporting/telerik-reporting/how-to-handle-errors-exceptions.aspx
which provides a nice piece of c# code.
I have translated this to VB to get this :
          
 AddHandler _rptBody.[Error], Sub(innerSender As Object, eventArgs As ErrorEventArgs)
      Me.ReportViewer.Report = Nothing
       Me.Label1.Text = eventArgs.Exception.Message.ToString()
End Sub


But sadly Visual Studio informs me that :

Error is not an event of object.

I have to say that c# is my language and not VB but sadly I have to do this in VB.

Am I doing something wrong here?

1 Answer, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 10 Aug 2012, 08:31 AM
I have been stepping through the code I have been given and noticed that the assembly is being reflected as of type object which explains a lot.
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Share this question
or