LblGenProDataSource2 bespoke databinding

Posts   
 
    
Shorty
User
Posts: 18
Joined: 12-Jan-2007
# Posted on: 12-Jan-2007 16:02:03   

ASP.NET 2.0 webforms. I wish to use this control as my datasource with bespoke binding and unbinding of web controls (ie not using formview,gridview etc). The llblgenpro control has a select procedure so I can retrieve data. I can unbind my web page controls back to the contained collection within the lblgenpro datasource. Yet there appears to be no procedure the datasource exhibits which I could call to persist these changes. (via a unit of work). Am I missing something?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 13-Jan-2007 02:29:41   

Sorry I'm not quite sure what problem you are running into. The LLBLGenDataSource2 can fetch and persist the data. Please read the Generated code - Databinding with ASP.NET 2.0, Adapter section of the manual and if this doesn't help with your problem could you possibly include an example for your issue?

Shorty
User
Posts: 18
Joined: 12-Jan-2007
# Posted on: 15-Jan-2007 12:19:58   

Note Live Persistence = false; 1 record in the entity collection.

I am creating my own form structure which contains an entity spread over multiple tabs. When the user posts causing a tab change, I wish to unbind the changes on the current tab directly back to the entity in the datasource control. These changes can then be reflected in the new tab as I can rebind my controls against the entity in the contained collection. This action will mark the entity as dirty but does not create a unit of work. I wish my user to make changes across all the tabs before saving to the database.

Note: Im trying to avoid the Microsoft controls such as formview and gridview as developer control over the binding process is at best tenuous. (Weve all had selected value not in dropdownlist and the page explode in an asp trace stack error). In addition this functionality is unlike the Microsoft provided controls as to see the reflected changes in the new tab using formview etc I would be forced to save to the db on every tab change)

I wish use the llblgenpro datasource almost like a rollback segment. User can perform changes to the data and see those outcome of the changes on the entity without commiting incomplete transactions to the database.

The datasource control only provides a protected executeupdate targeting microsoft binding (via collection of old and new values) which does create a unit of work.

My question is if I unbind my controls directly to the entity in the contained collection in a bespoke fashion (to allow better handling of binding errors). I need a method I can call to check if the entity is dirty and if so create the unit of work.

As the datasource exhibits this unit of work as a property I could then save this to the database when the user clicks save.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 16-Jan-2007 09:28:54   

There are many un-clear things to me.

Are you using tabs in the same web page or each tab opens a new web page? Are you enabling the view state on the LLBLGenProDataSource?

Please post some code for more understanding.

You can keep a UOW around in a session variable or something, that you can use when saving the LLBLGenProDataSource.

Shorty
User
Posts: 18
Joined: 12-Jan-2007
# Posted on: 16-Jan-2007 11:26:18   

Thanks for the reply.

The tabs are on the same page which shows user controls via a multiview. My own binding can retrieve and update the entity within the datasource control viewstate. However making these changes directly does not allow the control to create a unit within the datasource control.

Am I better of just loading the individual entity into the view state without the datasource control and create my own unit of work to persist the changes to the db.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 17-Jan-2007 03:09:51   

Am I better of just loading the individual entity into the view state without the datasource control and create my own unit of work to persist the changes to the db.

I would feel more comfortable with this, but someone else may be able to help you use a datasourcecontrol.