Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try and catch not working
Message
 
 
To
15/08/2008 01:24:25
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Oracle
Miscellaneous
Thread ID:
01339066
Message ID:
01339081
Views:
15
There is nothing in the Try block. What exception could be caught if nothing is happening? When the (empty) Try block completes, execution does not fall through to the Catch, it jumps down to the Finally.

>Dear All,
>
>I am expecting to see a nice and friendly "caught an exception" in DetailView itemInserting event below.. but it doesnot work ..
>could any body please explain.. what I missed?
>
>Regards
>Winanjaya
>
>
>Private Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles DetailsView1.ItemInserting
>
>Dim log As System.Diagnostics.EventLog = New System.Diagnostics.EventLog
>
>Try
>
>Catch ex As OracleException
>Dim errMsg As String = "Code: " & ex.Code & vbCrLf & _
>"Message: " & ex.Message
>e.Cancel = True
>log.Source = "My Application"
>log.WriteEntry(errMsg)
>Console.WriteLine("An Oracle exception occurred, please contact your system Administrator.")
>
>Catch ex As Exception
>Dim errMsg As String = ex.Message
>e.Cancel = True
>log.Source = "My Application"
>log.WriteEntry(errMsg)
>Console.WriteLine("An other exception occurred, please contact your system Administrator.")
>
>Finally
>
>End Try
>
>End Sub
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform