Null Date field in GridView

Posts   
 
    
TogasPoon
User
Posts: 42
Joined: 09-Feb-2006
# Posted on: 18-Aug-2006 21:31:14   

ASP.Net 2.0 ORMapper = LLBLGen 2.0 Runtime Library = ORMSupportClasses.NET20.dll v2.0.0.50727 Template = SelfServing IDE = VS 2005

I have a nullable date field that being edited on a Gridview. If it starts out as null, no problem but if I try and change an existing value to Null nothing happens.

I thought this was simplified in 2.0 but maybe I'm missing something.

The Field is checked as Is Nullable in the designer as well as (.NET 2.0) Generate as Nullable Type.

The Grid is connected to a LLBLGenProDataSource, EntitiyCollection

Thanks in advance.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 19-Aug-2006 02:50:46   

Please check the manual under Using the Generated Code -> Adapter -> Databinding -> Databinding with ASP.NET 2.0 -> Converting empty string values ("") to NULL values for inserts/updates.

TogasPoon
User
Posts: 42
Joined: 09-Feb-2006
# Posted on: 21-Aug-2006 16:01:31   

I made the change per your suggestion but it didn't make a difference. It seems like that change has more to do with String datatypes not Datetime.

TogasPoon
User
Posts: 42
Joined: 09-Feb-2006
# Posted on: 21-Aug-2006 18:53:31   

hmmm...

I did some more digging, the entity is based on a view. I thought it was strange that I had to manually check that the entity field was Nullable since I didn't recall doing that with other entities. If I create a entity based on the table with the nullable date field everything works great.

I was able to tweak my design so I can use the table entity instead of the entity based on the view. Not sure if this is a limitation of entities on views or a bug.

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 21-Aug-2006 20:35:53   

Hi,

I tried to find something, which may cause that in the source code but couldn't. Would you agree sending us a package containing your script, your lgp project, and your code, so that we can quickly reproduce the strange behaviour?

You can email it to support@llblgen.com

Thanks in advance,

Jesse