Create a new Entity Collection and Save

Posts   
 
    
Mennisujay
User
Posts: 11
Joined: 25-Feb-2005
# Posted on: 25-Feb-2005 10:57:45   

hi,

My application is Asp.net application. In my application i will get set of records which are already there in DataBase from GUI. With these records I should create an EntityCollection and would be able to save, which will modify the existing records in DataBase. I need not add any new entity or delete.

I don't want to fetch collection, rather I am able to create the entity collection and add records, but if I am saving, the records are saving as new records i,e. throwing an exception that Primary key duplication voilation. How can I change the exisiting records at once by creating EntityCollection in my CodeBehind.

Any help on this will be greatly appreciated. Urgent help needed. Sujay

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 25-Feb-2005 11:53:47   

For each entity, set the IsNew property to false. This will make the LLBLGen Pro code use an update query instead of an insert query.

Frans Bouma | Lead developer LLBLGen Pro