DateTime fields being discarded

Posts   
 
    
kirkus
User
Posts: 2
Joined: 03-Feb-2005
# Posted on: 08-Feb-2005 22:17:42   

I am having an issue where Date fields are not being saved to the database on insert. I am using Adapter, and have traced the code all way to my .SaveEntity() call, and just before the call I can see the proper values in all fields when inspecting the entity in the Watch window. I have int, decimal and varchar fields that all save properly, but for some reason, no dates are making it to the database.

The only thing I am doing differently from standard usage is calling the ForcedCurrentValueWrite method when populating the entities:

claimServiceItem.Fields[mapping.DestinationColumn].ForcedCurrentValueWrite(destValue);

since this is a data import scenario where the column names are dynamically provided.

Help!

  • Kirk
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Feb-2005 23:05:59   

Do not use that method, as that method will not set tracking flags and your values will not be saved. Use entity.SetNewFieldValue(index, value)

Frans Bouma | Lead developer LLBLGen Pro
kirkus
User
Posts: 2
Joined: 03-Feb-2005
# Posted on: 09-Feb-2005 00:16:38   

Otis wrote:

Do not use that method, as that method will not set tracking flags and your values will not be saved. Use entity.SetNewFieldValue(index, value)

DUH! Works like a charm.

Thanks.