Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> Trap Error after calling Entity.Save
 

Pages: 1
Bugs & Issues
Trap Error after calling Entity.Save
Page:1/1 

  Print all messages in this thread  
Poster Message
Dan1
User



Location:

Joined on:
20-Sep-2007 16:09:06
Posted:
41 posts
# Posted on: 03-Oct-2007 22:03:57.  
I'm trying to trap an error in a try and catch. I am getting an error (Unique Key Violation) on the following method in my entity class.

Protected Overrides Overloads Function UpdateEntity() As Boolean
            Dim dao As WeldSpec_SpotDAO = CType(CreateDAOInstance(), WeldSpec_SpotDAO)
            Return dao.UpdateExisting(MyBase.Fields, MyBase.Transaction)
        End Function


This error occurs after I call the .Save method on an instance of the entity. I have wrapped the .Save in a try/catch but it does not catch it.

        Try
            x.Save()
        Catch ex As Exception
            MsgBox("Exception")

        End Try

Am I missing something here? Seems pretty basic, but I am not sure how to trap this.
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8148 posts
# Posted on: 04-Oct-2007 02:35:29.  
Hi Dan,

Did the error throws at your method UpdateEntity() ? At what line exactly the error ocurrs? This often results in a scope-thing... Could you thing more elaborate code to show where are you traping the exception?

Regards,


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.