Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Try and catch not working
Message
 
 
À
15/08/2008 01:24:25
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Oracle
Divers
Thread ID:
01339066
Message ID:
01339081
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform