StrataFrame Forum

Default value in field

http://forum.strataframe.net/Topic31806.aspx

By Olivier - 2/7/2013

Hello,

I use a default value for all my field in sql Server with DDT , i don't want null value.

When i use this.MyBo.Add();  , i have a error when i save , cause Strata say me, cast is impossible on RUE_ID (my foreign key)
if after the add i instantiate with 0 or -1 , it's ok, without this it's doesn't work.

It's possible that Strata can instantiate with the default value when i use Add() method ?

thanks
Olivier,
By Edhy Rijo - 2/8/2013

Hi Olivier,
You have to handle the nulls in the Business Object Mapper and set the Null Value Option to one that fix your need, in my case I mostly use "Return Altername on Null" and set the appropriate value for my integer FK fields to 0 and strings to String.Empty