Persisting changes from a datagridview

Posts   
 
    
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 26-Apr-2006 01:20:29   

Hi,

Having populated a datagridview with the contents of a Collection, made some changes to it, then called the following code to save all the changes:

    Dim Division As New DivisionCollection()
    Division = DataGridView1.DataSource
    Division.SaveMulti(True)

I'm wondering if there is a better way to persist the changes made. As I'm just getting to grips with LLBLGEN Pro, any feedback whatsoever is welcome.

I'm using VS2005, SQL Server, the current LLBLGEN Pro and Self-Service.

Thanks

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 26-Apr-2006 03:24:23   

Something you may need to be aware of, is that this will not delete any deleted entities. If you wish to delete entities that were removed from the grid you will need to do that by either deleting the entity manually or placing all deleted entites into a collection and delete that collection when necessary.

Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 27-Apr-2006 00:55:33   

bclubb,

Thanks for that observation, which has helped me see how users should interact with my Forms. simple_smile