bool and null

Posts   
 
    
Yves
User
Posts: 2
Joined: 20-Apr-2006
# Posted on: 20-Apr-2006 15:28:11   

Hello,

maybe a very simple one, but i just can't find a solution

in one of my tables (SQLServer2000) i have some bit fields (nullable). LLBLGen converts them to bool properties in the entity class. How do i set on of these fields to null (DBNull.Value) ?

regards,

Yves

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Apr-2006 15:41:12   

Use the Entity.SetNewFieldValue() method

Please refer to "Entities, NULL values and defaults" under "Using the generated code -> SelfServicing/Adapter -> Using the entity classes"

And

"How do I insert a NULL value for a field in an existing entity?" under "Best practises -> How do I ... ?"

in the LLBLGen Pro manual

Yves
User
Posts: 2
Joined: 20-Apr-2006
# Posted on: 20-Apr-2006 15:55:15   

Tahnk you very much for the fast answer, it works. I'd tried SetNewFieldvalue, but insted of null i passed DBNull.value, which lead to an exception.

regards, Yves