Link to home
Start Free TrialLog in
Avatar of Moiz Saifuddin
Moiz Saifuddin

asked on

unique constraint

How do I catch a unique error constraint error on a try and catch block.....

say i want to trap a specific error like

if constraint_error then

' DO THIS

end if
ASKER CERTIFIED SOLUTION
Avatar of slyckboy
slyckboy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of platinumbay
platinumbay

       Dim constraint_error As Boolean = True
        Try
            If constraint_error Then Throw New Exception(constraint_error.ToString)
        Catch ex As Exception
            Response.Write("#" & ex.ToString & "#")
        End Try