Nullables in VB.NET with ?

I don’t know whether this is just in the new version of the VB.NET compiler which goes with Visual Studio 2008 or whether I just missed it completely in 2005, but I have just noticed that you can declare Nullables in VB.NET the same way you can in C#.

For example, you can do

Dim CustomerID as Integer?

Note the question mark on the end – this indicates that it is nullable.

No related posts.

Tags: , ,

Leave a Reply