﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Problems with NULL</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 03:39:06 GMT</lastBuildDate><ttl>20</ttl><item><title>Problems with NULL</title><link>http://forum.strataframe.net/FindPost13933.aspx</link><description>I'm using DDT to setup a new database.&amp;nbsp; When I started I uncheked "Allow Null default value."&amp;nbsp; Don't know why - just thought that's what I was supposed to do...&lt;/P&gt;&lt;P&gt;I was able to setup my table and put fields on a form - no problems.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I decided to add a couple of fields and the deployment to the server fails - b/c "Allow Null" is not checked (like the other fields.)&amp;nbsp; If I check the field - the deployment works - but the app fails with a "Conversion from type 'DBNull' to type 'String' is not valid."&lt;/P&gt;&lt;P&gt;Just need someone to tell me where I messed up and how to fix it - thanks!&lt;/P&gt;&lt;P&gt;HB</description><pubDate>Fri, 01 Feb 2008 14:29:15 GMT</pubDate><dc:creator>Howard Bennett</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13953.aspx</link><description>No problem :)</description><pubDate>Fri, 01 Feb 2008 14:29:15 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13952.aspx</link><description>Thanks for the help...again...</description><pubDate>Fri, 01 Feb 2008 13:55:41 GMT</pubDate><dc:creator>Howard Bennett</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13950.aspx</link><description>Correct.&amp;nbsp; You really don't want to allow null values within a database if you have control over it.&amp;nbsp; When you initially create your structures, you can leave the Default blank and not select Allow Nulls and deploy without any type of error as you are deploying a new structure where there are no records...thus no field values have to be initialized.&amp;nbsp; But when you go back into that structure and add new columns to an already deployed table, you will want to be sure to supply a default value, otherwise you will run into the issue that you experienced.&amp;nbsp; But it is best to &lt;STRONG&gt;&lt;U&gt;&lt;EM&gt;not&lt;/EM&gt;&lt;/U&gt;&lt;/STRONG&gt; allow nulls. :)</description><pubDate>Fri, 01 Feb 2008 13:52:13 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13947.aspx</link><description>So...let me be sure I've got this straight...&lt;/P&gt;&lt;P&gt;When I setup the table - I am correct in unchecking the "Allow Nulls" checkbox - and when adding fields, I need to be sure there is a default value and the "Allow Nulls" is not checked.&amp;nbsp; Is that right?</description><pubDate>Fri, 01 Feb 2008 13:44:52 GMT</pubDate><dc:creator>Howard Bennett</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13946.aspx</link><description>I played around with that - but apparently not the right combination of allow nulls and default values.&amp;nbsp; It's working now with a default value and "Allow Nulls" not checked. Thanks for your help!</description><pubDate>Fri, 01 Feb 2008 13:42:10 GMT</pubDate><dc:creator>Howard Bennett</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13945.aspx</link><description>Okay - that did the trick - thanks!</description><pubDate>Fri, 01 Feb 2008 13:41:08 GMT</pubDate><dc:creator>Howard Bennett</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13940.aspx</link><description>Wow...you guys are getting good :D&amp;nbsp; Ivan and Greg are right.&amp;nbsp; Property standards really lean away from default value support, you are better off assigning a default value.&amp;nbsp; The reason this worked initially is because you did not have any records.&amp;nbsp; But now that you have records in the table, you just need to assign a default value so that the existing records will initialize their fields with a value rather than DBNULL.</description><pubDate>Fri, 01 Feb 2008 13:16:13 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13937.aspx</link><description>Ivan's got it right. If you have existing data in the database and you need to add a field that does not allow NULLs, then you have two options (these are SQL Server restraints, not DDT restraints...or rather, the DDT just has to live with the SQL server restraints):&lt;br&gt;
&lt;br&gt;
- You add the field and set it to not allow NULLs and you [u][b]must[/b][/u] set a default.&lt;br&gt;
- You add the field and allow NULLs, then after the field is added, you go in and populate the new field with data, then go back and change the field to not allow NULLs.&lt;br&gt;
&lt;br&gt;
The first is almost always the way to go unless there is something complicated going on with the field.  &lt;br&gt;
&lt;br&gt;
Note that if you need to change a field that was formally NULL to one that is NOT NULL (SQL terminology here), then the same issue applies with the same possibilities.&lt;br&gt;
&lt;br&gt;
Hope that helps!</description><pubDate>Fri, 01 Feb 2008 13:10:14 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Problems with NULL</title><link>http://forum.strataframe.net/FindPost13936.aspx</link><description>Hi Howard!&lt;P&gt;At the time you were adding new fields into your table at the DDT, have you tried assigning "Default Values" on the Additional Settings group?</description><pubDate>Fri, 01 Feb 2008 12:50:21 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>