Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Try and catch not working
Message
De
15/08/2008 10:08:21
 
 
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:
01339106
Vues:
16
Hello,

Basically I want to check unique constraint of the primary key, in DetailsView_ItemInserting I am trying to check user's entry.. but I am enable to check unique constraint .. any idea? (sorry, I am totally new to .NET ..sounds like silly question ;>)

TIA


Private Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles DetailsView1.ItemInserting
Try
For Each de As DictionaryEntry In e.Values
If de.Value Is Nothing Then
LblMsg.Text = "Cannot insert an empty value."
e.Cancel = True
End If
Next
Catch ex As OracleException
Dim errMsg As String = ex.Message
LblMsg.Text = errMsg
e.Cancel = True
Catch ex As Exception
Dim errMsg As String = ex.Message
LblMsg.Text = errMsg
e.Cancel = True
Finally
End Try
End Sub
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform