> When for example retrieving a null value from a database ...
> because the DateTime structure cannot have null reference
> assigned to it ... you end up having to check every time
> you want to attempt to assign it.

Here's a complete set of nullable valuetype wrappers for database logic in
.Net:

http://nullabletypes.sourceforge.net

That said, I want to recommend that most database fields should NOT be
nullable.  The only really useful place for nullability in databases is in
foreign key references, and most of those should probably be references to
the "default object" so that all nullable-reference handling is consistent.
This is the NullObject Pattern:

http://www.cs.oberlin.edu/~jwalker/nullObjPattern/
http://www.owlnet.rice.edu/~comp212/00-spring/handouts/week06/null_object_re
visited.htm


Specifically date-times are much better set to 1/1/1900 00:00:00 and
12/31/9999 23:59:59 (or whatever your database will accept) so that clauses
using BETWEEN or > or < work without the explicit NULL checks.

Please, please read Richard Snodgrass' excellent book "Developing
Time-Oriented Database Applications in SQL":
http://www.amazon.com/exec/obidos/tg/detail/-/1558604367/qid=1065806211/sr=1
-9/ref=sr_1_9/103-8651349-0782225?v=glance&s=books

Marc

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to