﻿<?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?)  » DBNULL...again</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 01:52:26 GMT</lastBuildDate><ttl>20</ttl><item><title>DBNULL...again</title><link>http://forum.strataframe.net/FindPost16120.aspx</link><description>Scenario:&lt;/P&gt;&lt;P&gt;I have inherited a table with two fields, one decimal, one string. These together represent the primary key. I need both fields on a maintenance form, bound to textboxes.&lt;/P&gt;&lt;P&gt;Display/Edit/Save is working. I cannot get a new record to add.&lt;/P&gt;&lt;P&gt;I get 'Conversion from type 'DBNull' to type 'String' is not valid.' on the line:&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;Return&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.CurrentRow.Item(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"ITREPORT"&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;), System.String) in the field properties. I tried to set the defaultValues and the first one sets fine, the second always gives the above error, regardless of the order set. I have PrimaryKeyIsAutoIncremented = False, PrimaryKeyIsUpdateable = True, and even tried out AllowNullsOnNewRow = True. The database fields (DB2) are set to not allow nulls, and have default values set.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I know this could be fixed easily by adding a proper autoincrement key column but I cant, the table is part of a legacy system and the customer is insistant it work as described above, frankly I'm not sure why it isnt. It works fine if the fields are unbound from the textboxes.&lt;/P&gt;&lt;P&gt;I must be missing somethign simple. Which is likely since I havent been coding much lately.&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 06 May 2008 13:28:43 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16192.aspx</link><description>Cool :cool:</description><pubDate>Tue, 06 May 2008 13:28:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16185.aspx</link><description>All fixed. Reinstall of 1.6.5 did the trick. Thanks.</description><pubDate>Tue, 06 May 2008 12:59:19 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16176.aspx</link><description>Yeah, this is one of the tables structures that we changed.&amp;nbsp; Let me know if you don't get it going. :)</description><pubDate>Tue, 06 May 2008 08:51:47 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16168.aspx</link><description>I see table structure changes between the working and non-working for table "DTEproject_item_exceptions" that seems to hold the customization data. I'll try that in the AM.</description><pubDate>Mon, 05 May 2008 22:58:37 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16167.aspx</link><description>I am still fighting this, no resolution as of yet. I will reinstall 1.6.5 at customer site to make sure the database is updated, unless you can tell me how to check the current version of the Strataframe database?</description><pubDate>Mon, 05 May 2008 22:31:00 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16166.aspx</link><description>It sounds like you just did not have the database up to date.&amp;nbsp; We added a few fields in 1.6.5...so that is probably what you were fighting.</description><pubDate>Mon, 05 May 2008 21:18:22 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16165.aspx</link><description>Yes if I point back to the original database everything is fine, I did realize that I would have to recreate the project data, it let me redfine the BO's and everything I needed to do EXCEPT the customization. It just ignores and changes&amp;nbsp;I make in the edit customizations screen.&lt;/P&gt;&lt;P&gt;The new database will be the master from now on, I have VPN access to it.</description><pubDate>Mon, 05 May 2008 19:02:10 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16158.aspx</link><description>[quote] Could this happen if the Strataframe database was not up to date? If so, how can one tell if it is up to date or not? I think it should be but am not 100% sure.[/quote]&lt;/P&gt;&lt;P&gt;Well, it is possible that your SF database is not up to date, but the issue here is that you created the custom code in Database 1 and are now wanting to work on Database 2.&amp;nbsp; So that code that was in DB1 is not going to be there.&amp;nbsp; If you set your data source base to DB1, do you get your stuff back?&lt;/P&gt;&lt;P&gt;That is the first thing I would make sure of.&amp;nbsp; Then...well...we can try to come up with the best solution for working like this.</description><pubDate>Mon, 05 May 2008 16:41:21 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16154.aspx</link><description>1) My banaid broke. I changed the SF Data Store for the project from my SQL Server to my customers as they want&amp;nbsp;to start "helping"&amp;nbsp;and now I cannot set any custom properties on the fields in the mapper, they simply dont "stick". Could this happen if the Strataframe database was not up to date? If so, how can one tell if it is up to date or not? I think it should be but am not 100% sure.&lt;/P&gt;&lt;P&gt;If not, what might be causing this, I need my bandaid back as it is not clear to me what the underlying problem is.&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;2) Field_ITREPORT_Descriptor is making the call to the get&amp;nbsp; for &lt;STRONG&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; [ITREPORT]() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.String&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;</description><pubDate>Mon, 05 May 2008 14:33:49 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16147.aspx</link><description>Sounds good.&amp;nbsp; I know that something is trying to pull the value on the AddNew or Navigated....something along those lines.&amp;nbsp; So just to prevent any downstream issues it would definitely be a good idea :)</description><pubDate>Mon, 05 May 2008 10:28:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16134.aspx</link><description>Will do,&amp;nbsp;I didnt think this step was required since I hadn't done it before, for now I'll take the bandaid but I will try to find the original&amp;nbsp;problem also.</description><pubDate>Mon, 05 May 2008 09:47:22 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16132.aspx</link><description>[quote]I'll admit I am confused why that step was necessary, but I'll save that for another day, unless someone is feeling like enlightening[/quote]&lt;/P&gt;&lt;P&gt;The solution will prevent the error, but is not the cause of the error.&amp;nbsp; You actually should not have to do this.&amp;nbsp; From what I understand, you are creating a new record.&amp;nbsp; At this point, the database type has no relavance as all of this is intrinsic to the BO.&amp;nbsp; So it would appear that when you are adding a record the fields are not being initialized...and/or you are referencing this field either through a manual binding, event, or some other code before it gets initialized.&lt;/P&gt;&lt;P&gt;By default, a BO has the AllowNullValuesONnewRow set to false, which forces all rows to be initialized with a default value when a new row is created.&amp;nbsp; So the NULL is not coming from there...it is happening in the Get of the strong-typed property which means that something is trying to call a GetValue &lt;EM&gt;&lt;U&gt;before&lt;/U&gt;&lt;/EM&gt; it is initialized.&lt;/P&gt;&lt;P&gt;You might check your mappings or place a breakpoint in the Get of the property to see what is pulling the value.&amp;nbsp; You have a "bandaid" on it so to speak and it would probably be a good idea to find the source of the issue.</description><pubDate>Mon, 05 May 2008 09:34:45 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16131.aspx</link><description>Makes sense Edhy, thanks.</description><pubDate>Mon, 05 May 2008 08:43:47 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16130.aspx</link><description>[quote][b]Keith Chisarik (05/05/2008)[/b][hr]I'll admit I am confused why that step was necessary, but I'll save that for another day, unless someone is feeling like enlightening :)[/quote] &lt;P&gt;Well basically that step is there to allow you to handle your specific&amp;nbsp;database Null values, so you can accommodate your SF project to be compatible with any DBNull schema used.&amp;nbsp; In your particular case you don't have access to modify the database the way you want it, but that will not stop your SF project to keep working. &lt;P&gt;Just my 0.02 :)</description><pubDate>Mon, 05 May 2008 08:42:40 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16128.aspx</link><description>Thank you both, that worked!&lt;/P&gt;&lt;P&gt;I'll admit I am confused why that step was necessary, but I'll save that for another day, unless someone is feeling like enlightening :)</description><pubDate>Mon, 05 May 2008 08:18:40 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16127.aspx</link><description>[quote][b]Keith Chisarik (05/05/2008)[/b][hr]Is that feature under "Customize" in the mapper? I cant find it elsewhere and for some reason "Customize" and "Clear" are greyed out and the customization wizard bombs out on me.&amp;nbsp;[/quote]&lt;/P&gt;&lt;P&gt;Hi Keith,&lt;/P&gt;&lt;P&gt;In the BO Mapper, just double click the field you want to modify and on the right side of the Custom Field Properties, set the NULL&amp;nbsp; Value Option to "Return Alternate on Null" or any other that apply to your case.</description><pubDate>Mon, 05 May 2008 07:56:06 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16125.aspx</link><description>Is that feature under "Customize" in the mapper? I cant find it elsewhere and for some reason "Customize" and "Clear" are greyed out and the customization wizard bombs out on me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;NullReferenceException&lt;BR&gt;&amp;nbsp; Object reference not set to an instance of an object.&lt;/P&gt;&lt;P&gt;Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MicroFour StrataFrame AddIns&lt;/P&gt;&lt;P&gt;Stack Trace: &lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.AddIns.DTEprojectsBO.FillProjects(String[] ProjectPaths)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.AddIns.PartialClassBuilderCustomizeWizard.ᜀ(ᜏ A_0)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.AddIns.PartialClassBuilderCustomizeWizard.ᜀ()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.AddIns.PartialClassBuilderCustomizeWizard.OnLoad(EventArgs e)</description><pubDate>Mon, 05 May 2008 07:39:10 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16124.aspx</link><description>No, both columns are set to disallow NULL. I will try your suggestion now. Thanks.</description><pubDate>Mon, 05 May 2008 07:26:59 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16122.aspx</link><description>Hi Keith,&lt;/P&gt;&lt;P&gt;You could try "Return alternate.." in the BO mapper and set the alternate to "String.Empty".&lt;/P&gt;&lt;P&gt;Do you need to be able to store nulls in that column in database? We don't allow any database column to be nullable unless it is absolutely necessary.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Mon, 05 May 2008 03:18:01 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: DBNULL...again</title><link>http://forum.strataframe.net/FindPost16121.aspx</link><description>I should add I'm on 1.6.5</description><pubDate>Sun, 04 May 2008 22:39:11 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item></channel></rss>