LLBLGen v2.6 Self-Servicing with SQL Server - Default Values

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 11-Aug-2009 19:22:08   

Hello,

I'm having an issue with default values in an entity - the entity is not being saved correctly to the database.

I'm declaring an object as follows:

Dim MyEntityObject As New MyEntity(Now.Year, Now.Month, Now.Day, Now.Hour, Key)

Assuming MyEntity does not exist in the database, it will return a new instance - this is working correctly.

Now if I go (assuming the entity did not existing in the database)

MyEntityObject.SomeValue = 1 MyEntityObject.Save

This will throw an exception. I inspected the SQL code, the fields, like Year, Month, Day, Year are not being sent to the database. The entity believes them to be defaults and not "new" / "dirty" fields.

I need to reassign all the fields for the entity to be saved.

My question is: if an entity is marked as new, why arne't all the fields being sent to the database?

Thanks.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 11-Aug-2009 22:49:20   

Hi

Please can you give us some more details - see http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7717

Thanks

Matt