Bulk Save

Posts   
 
    
Posts: 2
Joined: 26-Jan-2005
# Posted on: 26-Jan-2005 13:19:03   

Hello.

I do have a collection of data items. (ex. user accounts). I want to make the Field of the Accounts Table Accounts.Active = true to all the accounts of my database. I wish to make this through a Collection. How can I perform this without changing the other fields of the same table like password and Logins and so on?

Best regards.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Jan-2005 13:29:11   

Just change the field in the entities in the collection and then save the collection. Only the changed fields are updated, the rest are not changed/affected.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 2
Joined: 26-Jan-2005
# Posted on: 26-Jan-2005 15:26:23   

Do you mean that if I create an Entity and set only a value of Active=1 and do myAccountsCollection.UpdateMulti and paste this var it will update only the Active field ?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Jan-2005 17:12:04   

chouffainet wrote:

Do you mean that if I create an Entity and set only a value of Active=1 and do myAccountsCollection.UpdateMulti and paste this var it will update only the Active field ?

Yes. Do keep in mind that UpdateMulti creates an update query using the set values in the entity specified, using the filter specified. If you don't specify a filter it will update all entities.

Frans Bouma | Lead developer LLBLGen Pro