﻿<?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?)  » NULL values</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 04:15:09 GMT</lastBuildDate><ttl>20</ttl><item><title>NULL values</title><link>http://forum.strataframe.net/FindPost10859.aspx</link><description>I took at a number of forum posts but I can't seem to solve my issue with Nulls. I don't use nulls a whole lot.&lt;/P&gt;&lt;P&gt;I have a field in my notes&amp;nbsp;table called ContactFK. (Integer,Nullable).&amp;nbsp; It's a foreign key to my contacts table. The contact is optional on a note.&amp;nbsp; I set the&amp;nbsp;NULL value option in the BO Mapper to 'Use Nullable Generic'. &lt;/P&gt;&lt;P&gt;When I set my field to nothing I get an error 'Specified Cast is not valid' on the following line of code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;(component, CRMEntryBO).ContactFK = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;(Value, Nullable(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt; System.Int32))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Is there something wrong with this setup?&amp;nbsp; I used Nullable generic a while back for a System.Double and it worked fine.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;TIm&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 16 Aug 2007 07:46:21 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: NULL values</title><link>http://forum.strataframe.net/FindPost10889.aspx</link><description>The table is not in the database I sent you.</description><pubDate>Thu, 16 Aug 2007 07:46:21 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: NULL values</title><link>http://forum.strataframe.net/FindPost10883.aspx</link><description>Is this field in the table structures you sent me the other day?&amp;nbsp; If so I will look at this when I look at your table structure.</description><pubDate>Wed, 15 Aug 2007 14:35:51 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: NULL values</title><link>http://forum.strataframe.net/FindPost10869.aspx</link><description>Unfortunatley I got the same result. 'Invalid Cast DBNull to Integer'&lt;/P&gt;&lt;P&gt;What's the best way to handle the following situation.&amp;nbsp;(I can use NULL or Not Null, as long as I get it working).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a note table with&amp;nbsp;a field called NoteContact (Int). It's a FK to my contacts table.&amp;nbsp;I do not have to specify a contact for my note.&lt;/P&gt;&lt;P&gt;I have a combobox on my form bound to my NoteContact field. I populate using the population data source settings. I display the contact name on the dropdown and my value member is the contact PK.&amp;nbsp;I should mention that my combobox type is a dropdown.&amp;nbsp; I need to be able to clear the value (I guess a zero or NULL value) or enter a contact that currently doesn't exist in the list. (I have logic to automatically create a new contact).&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim</description><pubDate>Wed, 15 Aug 2007 09:32:13 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: NULL values</title><link>http://forum.strataframe.net/FindPost10864.aspx</link><description>Try setting it to Return Alternate value on NULL and then return a zero without any quotes.&amp;nbsp; See if this resolves the error in your environment.</description><pubDate>Tue, 14 Aug 2007 15:27:57 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>