StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Allow null value in business objectExpand / Collapse
Author
Message
Posted 07/13/2006 6:09:51 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 07/18/2006 7:59:33 PM
Posts: 25, Visits: 46
Some of the fields in my table allow null value. Especially for datetime and decimal field. I want the default value of the controls, which mapped to these fields is null string ("") during initialization of add new record screen. How can I customize the fields in business object mapper so that the default value can be null string?
Post #1829
Posted 07/13/2006 8:43:04 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 2 days ago @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
When a new record it added, the business object automatically initializes the values within the new row to remove any DBNull.Value values.  To prevent this, and allow all of the fields within the new row to be NULL, set the AllowNullValuesOnNewRow property on the business object to True.

If you only want a few fields to have NULL values, then in the SetDefaultValues event handler, add this code:

Me.CurrentRow("fieldname") = DBNull.Value

Add that for each field you want to initialize as a null value, and you'll be good to go.


www.bungie.net
Post #1832
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 1:41pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.