Home All Groups Group Topic Archive Search About

TableAdapters and Nullable types - is there actually any support?

Author
28 Feb 2006 12:56 PM
Larry Lard
There seems to be something a bit lacking in the way the dataset
designer thing deals (or rather doesn't) with nullable fields in
VS2005. Maybe it's cos I'm using VB2005 Express (which is variously
crippled), I don't know. But it seems to me obvious that there should
be some way to specify that DB fields which can be null should be
mapped to appropriate Nullable(Of T) generic types. For fields there's
a dropdown in the dataset designer marked 'NullValue' which has the
comment 'A value returned if this column is null', which sounds
promising - but if you try to change this to (Nothing), it tells you
that for columns typed other than String, (Throw exception) is the only
option! Well duh, maybe disable the dropdown if the value can't be
changed?

I don't know what I am missing here - maybe nothing, and there just
isn't the support that to me seems obviously required. The docs are
amusingly crap even by the usual 2.0 standards:

(from 'TableAdapter Overview') :

TableAdapter Support for Nullable Types
The TableAdapters support nullable types Nullable(Of T) and T?. For
more information on nullable types in Visual Basic, see (link) Value
Types that Might Not Have a Defined Value.

(from 'Value Types that Might Not Have a Defined Value') :

Using Nullable Types with Data
A database is one of the most important places to use nullable types.
Not all database objects currently support nullable types, but the
designer-generated table adapters do. See "TableAdapter Support for
Nullable Types" in TableAdapter Overview.

.... and that's your lot. So, anyone know what this 'support' consist
of?

--
Larry Lard
Replies to group please

AddThis Social Bookmark Button