<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.lhotka.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Nullable'</title><link>http://forums.lhotka.net/search/SearchResults.aspx?s=5&amp;o=DateDescending&amp;tag=Nullable&amp;orTags=0</link><description>Search results matching tag 'Nullable'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP3 (Build: 36.8414)</generator><item><title>LoadProperty not converting null to empty string?</title><link>http://forums.lhotka.net/forums/p/11338/52655.aspx#52655</link><pubDate>Sun, 29 Apr 2012 17:51:09 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:52655</guid><dc:creator>ajj3085</dc:creator><description>&lt;p&gt;I&amp;#39;m having a problem which is a bit unexpected.&amp;nbsp; Basically, I&amp;#39;m using a command object to get some data from a SQL database.&amp;nbsp; The command object uses registered properties, one of which is a string.&amp;nbsp; The column in the database is nullable, and so LoadProperty is sent a value of null via the property setter.&lt;/p&gt;
&lt;p&gt;However, when I get the property using ReadProperty, I&amp;#39;m actually getting null back, which I didn&amp;#39;t think Csla did in the case of a string.&amp;nbsp; I&amp;#39;m used to it returning string.Empty.&lt;/p&gt;
&lt;p&gt;This happens through several other objects as well, as one object reads the property from the command object, and that object&amp;#39;s property is in turn read in another BO.&amp;nbsp; All the will, the null value is copied and return from Read/Get property as null instead of string.Empty.&lt;/p&gt;
&lt;p&gt;Has something changed in this regard, or is this a bug?&amp;nbsp; I&amp;#39;m using Csla 4.1.0.&lt;/p&gt;</description></item><item><title>Implementing IDProperty</title><link>http://forums.lhotka.net/forums/p/10799/50362.aspx#50362</link><pubDate>Mon, 24 Oct 2011 04:21:07 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:50362</guid><dc:creator>Smitty157</dc:creator><description>&lt;p&gt;How should basic IDProperties be implemented in BusinessBase objects?&lt;/p&gt;
&lt;p&gt;I have a BusinessBase&amp;nbsp;object that requires the selection of a value from a combo box control populated with a list of items from a NameValueListBase object.&amp;nbsp; The property on the BusinessBase object is defined as a Long.&amp;nbsp; This means that this value defaults to a 0 and thus always has a value.&amp;nbsp; While using data binding, if a user selects an option from the combo box and then clears the combo box the binding source object is trying to set my Long property to NULL, which causes a NULL to Long conversion&amp;nbsp;exception.&lt;/p&gt;
&lt;p&gt;Should the IdProperty be implemented as a Long type, or should a different type be used that accepts the use of a NULL value?&amp;nbsp; At times, Id&amp;nbsp;properties should allow the use of NULL values.&amp;nbsp; What type should be used to allow the user to insert NULL Id values into a database?&amp;nbsp; Also, since a long type always has a value (default of 0) the common Required rule never works.&amp;nbsp; It seems like the Long data type is not the correct type to use.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>Re: Bug with PropertyStatus when bound to nullable type and it's initial value is null</title><link>http://forums.lhotka.net/forums/p/8083/42327.aspx#42327</link><pubDate>Fri, 07 May 2010 07:27:55 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:42327</guid><dc:creator>elizas</dc:creator><description>&lt;p&gt;
&lt;div&gt;&lt;span&gt;&lt;span style="font-size:x-small;"&gt;The &lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&lt;a target="_self" href="http://www.mindfiresolutions.com/Nullable-Type-in-NET-674.php"&gt;nullable&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; type can represent a normal or regular set of values for its value type including the null value.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If we take an example of&amp;nbsp;&lt;span style="color:#008000;"&gt;bool&lt;/span&gt;&amp;nbsp;type, then Nullable&amp;lt;bool&amp;gt; can contain set of values like true or false or null.So, assigning null value to bool is useful when we are dealing with database in which the Boolean field may store value like true or false or it may be sometimes undefined.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div align="justify"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span&gt;&lt;span style="font-size:x-small;"&gt;Nullable Types are instances of System.Nullable struct.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span&gt;&lt;span style="font-size:x-small;"&gt;&lt;strong&gt;Declaration:&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span&gt;&lt;span style="font-size:x-small;"&gt;A nullable type can be declared similar to normal variable but with ? modifier at the end of keyword.For example,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:#0000ff;font-size:x-small;"&gt;int? number = null;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span style="font-family:Verdana;font-size:x-small;"&gt;Here ? denotes that the object is a Nullable object of that specific datatype(here it is int).&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span&gt;&lt;span style="font-size:x-small;"&gt;Alternative way of declaring Nullable type is,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:#0000ff;font-size:x-small;"&gt;Nullable&amp;lt;int&amp;gt; number = null;&lt;/span&gt;&lt;/div&gt;
&lt;div align="justify"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;</description></item></channel></rss>