Re: working with SQL null values....
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Mon, 14 Jul 2008 18:49:10 -0700
SurturZ wrote:
However, I have found that the "hacks" to avoid DBNulls are usually
easier to read than processing DBNulls. Let's face it, programmers
that allow DBNulls in their database usually have some little
function called NULLSAFE or something that converts DBNulls to empty
strings anyway.
For your example of apartment number, either the address is complete
or it isn't. If the apartment number is "" you can assume the address
is not an apartment and format the address appropriately.
I have no trouble with 0 length strings instead of null, but then again, I have
no trouble with null string fields in the first place. VB seems happy to return
"" from the ToString method.
For Dates, on the other hand, Nulls can be quite meaningful, where a fake date
is not helpful. When is the wedding? Null, for now. Specifying anything else
would be misleading.
.
- Follow-Ups:
- Re: working with SQL null values....
- From: SurturZ
- Re: working with SQL null values....
- References:
- working with SQL null values....
- From: Aussie Rules
- Re: working with SQL null values....
- From: Steve Gerrard
- Re: working with SQL null values....
- From: Lloyd Sheen
- working with SQL null values....
- Prev by Date: Re: .NET/ODBC queries Via the Internet
- Next by Date: Custom Project Templates (2005 vs 2008)
- Previous by thread: Re: working with SQL null values....
- Next by thread: Re: working with SQL null values....
- Index(es):