Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> How to trap failed Save using LLBLGenProDataSource2?
 

Pages: 1
LLBLGen Pro Runtime Framework
How to trap failed Save using LLBLGenProDataSource2?
Page:1/1 

  Print all messages in this thread  
Poster Message
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 28-Mar-2009 03:00:52.  
I'd like to try using an LLBLGenProDataSource2 instead of coding my persistence logic. However, I see from the documentation that the EntityUpdated (and EntityDeleted, EntityInserted) events are only raised if the update (or deletion, insertion) was successful.

How do I trap the case when update failed so that I can display a message to the user?

I'm used to objectdatasource's updated events which pass in the return value of the update method in the event args. LLBLGenProDataSource2 doesn't seem to have same thing.

Any tips other than making LivePersistence = false and writing my own code to persist entities? I really want to try a declarative-only solution for efficiency of writing new apps.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37880 posts
# Posted on: 28-Mar-2009 11:35:14.  
The general approach is that the bound control (e.g. a grid) will raise an event that an exception occured. The datasource itself simply bubbles up any exception occuring during saves/deletes so they always end up in the grid or other control which triggered the call on the datasource in the first place (as datasourcecontrols don't act by themselves). Does your control (e.g. the grid) offer an event which is raised when an exception occurs?

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


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

Version: 2.1.12172008 Final.