UpdateEntitiesDirectly

Posts   
 
    
ercwebdev
User
Posts: 9
Joined: 17-Jul-2012
# Posted on: 20-May-2013 18:14:13   

This code updates a single record, changing one field value - well, at least that's what it should do. However it doesn't change the value. Have tried this code in different ways, but without any success. It runs and doesn't report any errors. Wondered if anyone can see any problem with it before I ditch trying to use LLBL to do it and create a DAL method? Thanks, Alan


                RelationPredicateBucket bucket = new RelationPredicateBucket();
                bucket.PredicateExpression.Add(ErcHeritageMediumFields.ResourceId == ID);
                ErcHeritageMediumEntity media1 = new  ErcHeritageMediumEntity(ID);
                media1.Display = Request.Form["ctl00$MainContent$Related$ddImageStatus"];  //either Y or N          
                DataAccessAdapter adapter2 = new DataAccessAdapter();
                adapter2.UpdateEntitiesDirectly(media1, bucket);

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-May-2013 19:24:07   

This should work.

Which LLBLGen pro runtime library version (build no.) are you using? Please check the forum guidelines for that.

Also did you check the generated SQL Update statement?

ercwebdev
User
Posts: 9
Joined: 17-Jul-2012
# Posted on: 21-May-2013 13:40:12   

Yes, thanks! Turning on debug and looking at the SQL provided the answer. Many thanks. Alan