NotNull
- According to Paul Wilson, they’re [not actually implemented](http://weblogs.asp.net/pwilson/archive/2005/05/03/405512.aspx) into the framework. There is support for them, but they don’t really map. When you take a look at the example code below, you can see the declaration of a nullable integer. In the other two lines you see that you still need to check wether the value of the datareader is null or not. You cannot just insert the value of the datareader into the variable as this will throw an exception when it is indeed null.
- Also converting types and binding it to datagrids for example, will not just work.
- Paul also claims that the implementation is done purely by the C# team, and there’s no VB.NET support. Frans Bouma had the [same issue](http://weblogs.asp.net/fbouma/archive/2005/04/16/401155.aspx), but some readers responded with links to the [VBTeam weblog](http://blogs.msdn.com/vbteam/archive/2004/05/28/143813.aspx) and to [Panopticon Central](http://www.panopticoncentral.net/archive/2004/06/04/1180.aspx) where they also discuss the VB.NET & C# issue. So it it is possible in VB.NET, but with the same restictions I just mentioned.
- But there’s more to it. David Kean ran some [performance tests](http://davidkean.net/archive/2005/04/25/393.aspx), an noticed some (minor?) performance issues when using nullable types.
.csharpcode
{
font-size: 10pt;
color: black;
font-family: Courier New , Courier, Monospace;
background-color: #ffffff;
/white-space: pre;/
}
.csharpcode pre { margin: 0px; }
.rem { color: #008000; }
.kwrd { color: #0000ff; }
.str { color: #006080; }
.op { color: #0000c0; }
.preproc { color: #cc6633; }
.asp { background-color: #ffff00; }
.html { color: #800000; }
.attr { color: #ff0000; }
.alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0px;
}
.lnum { color: #606060; }