Hi,
before assigning the value readed from the DB you can check for
DBNull.Value , if true then you have to decide what to do, possibles options
include:
1- In case of values types assign a especific value, like Int32.MinValue,
Int32.MaxValue, etc
1.a - In references types, you can always assign null and later check for
it, or you can use a "default" instance
2- In case that all the values of a type are possible (like bool) you have
to define a wrapper, with two members, the value and a flag that indicate if
the value exist or not
3- Upgrade to 2.0 that include a nullable type
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Przemo" <Pr****@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Hi,
Imagine that we have a database and one table. Stored procedure returns 3
columns of table: ID, name, value.
Name and value can be a null in database. How to map or represent such
values in .net code? When I map a null value to a string or double
variable I
get an error.
I have heard that one of solutions can be converting and representing
db.null as a minimum value of used type. Is it a good technic? And what in
situaltion when I need all the values variable can represent from minimum
to
maximum?
Thanks.
Przemo