Can't save changes applied to fileds

Posts   
 
    
jvelarde
User
Posts: 2
Joined: 22-Jul-2005
# Posted on: 22-Jul-2005 03:20:46   

I'm trying to save changes aplied to field in a entity.

I'm accessing the fields by the name, then apply the changes by AcceptChanges(), and then execute Update(), but the changes aren't stored in the database.

This the code:

TesteTemex _Teste = new TesteTemex( 999 ); for( int i = 1; i <= 10; i++ ) { for( int j = 1; j <= 3; j++) { _Teste.Fields[String.Format( "Tempo{0}{1}", i, j )].CurrentValue = 456; _Teste.Fields[String.Format( "Tempo{0}{1}", i, j )].AcceptChange(); } } result = _Teste.Update();

=========================================== Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 22-Jul-2005 09:51:24   

Use: _Test.SetNewFieldValue(String.Format( "Tempo{0}{1}", i, j ), 456);

and no AcceptChanges(), that's not necessary for you to call.

Frans Bouma | Lead developer LLBLGen Pro
jvelarde
User
Posts: 2
Joined: 22-Jul-2005
# Posted on: 22-Jul-2005 16:19:13   

Otis, It's working fine.... This code save a huge of code, time and testing.

Thanks a lot!