Eden Ridgway's Blog

.Net and Web Development Information

  Home :: Contact :: Syndication  :: Login
  105 Posts :: 1 Stories :: 78 Comments :: 3 Trackbacks

Search

Article Categories

Archives

Post Categories

Development

General

.Net 2.0 will have nullable value types (int, string, datetime, etc.) but we all know that .Net 1.1 does not support them (SqlTypes are nullable though). The Nullable Types project at SourceForge is a project that attempts to overcome this limitation. It defines nullable types such as NullableBoolean, NullableInt32, NullableDecimal, NullableString and NullableDateTime to be used as replacements for the built in .Net value types. The wisdom of going with such a non-standard implementation is questionable, but it is very interesting.

Some of the features of the project are:

  • Like SqlTypes the nullable types all implement INullable
  • The types are serializable unlike SqlTypes
  • You should use SqlTypes in your DA layer and NullableTypes in your Business and UI layers
  • If the value is Null and you are converting to a standard .Net value type, such as an int32, it will still throw an exception
posted on Monday, July 11, 2005 2:27 AM
Comments have been closed on this topic.