Inserting an Entity using a FormView without using a datasource

Posts   
 
    
nilsey
User
Posts: 54
Joined: 11-Jan-2008
# Posted on: 30-Jan-2008 19:34:09   

Okay, I have successfully created a Formview and used an LLBLGenProDataSource to populate an Entity and insert it into a DB.

What I would like to know is how can I use a FormView to populate an Entity and trigger it's Entity.Save() method directly, without using an LLBLGenProDataSource?

It seems unnecessary to create a datasource which is potentially hitting a DB on page load just to use the insert funcitonality oif teh datasource when you can make an Entity and call it's Save method.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 31-Jan-2008 04:02:32   

What I recommend is that you continue using the LLBLGenDataSource as it provides the appropriate interface for your databinds.

There also exists a property called livepersistence, if you set that property to false you can control the insert /update and fetch functionality.

You can also not use the control and bind the collection directly and save it when you need it.

David Elizondo | LLBLGen Support Team