DBNull.Value

Posts   
 
    
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 20-May-2005 06:14:13   

I use this when databinding grids - at least I do when I'm databinding to datatables. Any chance of getting support for value in the entities?

Jeff...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-May-2005 11:30:33   

I hope with the type conversion functionality planned for the next update, to solve this problem. With that, you then can define a library which offers types and which implement some interface to convert from / to a value which you can use to define the types of fields. This then should offer nullable types for properties, though I've to work out the details for this.

Frans Bouma | Lead developer LLBLGen Pro
taylor74
User
Posts: 59
Joined: 06-Oct-2004
# Posted on: 22-May-2005 19:35:45   

About a week and a half ago I had an e-mail discussion with Otis about a null related topic and had a side thought I mentioned to him. It revolved around something I seen the CalendarCombo control in the Janus Suite implementing. Their control had a Value property typed as Date, but they also had a BindableValue property typed as Object so that the control could accept DBNull.

My thought was that the entities could implement Bindable... versions of the typed properties. Thus, we would still have access to the typed properties, but have nullable properties to use in data binding so '0' doesn't show up in a grid cell when the field is really null.

Otis said that should be easy to implement by using an include template to generate the Bindable... version properties and overriding GetProperties. Messing with templates is still a little advanced for me, because I haven't really had time to review the SDK docs yet. Wish I had his time management skills.

That's an interesting solution at least until the update comes out with type conversion functionality, which is probably the best way to solve this problem.

Jeff