T
tshad
I have people telling me that I should set up objects for my tables, but I
am finding the Null problem makes that difficult.
It isn't a big problem if you are not updating the table, but if you are -
it is a real problem if you have Nullable fields. You can't always use a 0
or -1 to tell whether a field is null and dates are another problem. I
don't want to use some obscure date in the future for something like
"EndDate" or "DateTerminated" where there is no ending date or an employee
hasn't been terminated yet.
You don't have a problem if you use a field on an asp.net screen, as an
empty field would be taken as null. But that is not the same in an object
where you have to define a value for your fields.
I can see some real advantages to using objects for my tables, but they seem
to be outweighed by being unable to handle the nulls in either vb.net or c#.
I'd be curious to know how others are handling this problem (without using 0
or 1 or obscure data).
The problem is not reading the data from the table, but when changes are
made and you need to write it back, you need to know when a field is
supposed to be Null.
Thanks,
Tom
am finding the Null problem makes that difficult.
It isn't a big problem if you are not updating the table, but if you are -
it is a real problem if you have Nullable fields. You can't always use a 0
or -1 to tell whether a field is null and dates are another problem. I
don't want to use some obscure date in the future for something like
"EndDate" or "DateTerminated" where there is no ending date or an employee
hasn't been terminated yet.
You don't have a problem if you use a field on an asp.net screen, as an
empty field would be taken as null. But that is not the same in an object
where you have to define a value for your fields.
I can see some real advantages to using objects for my tables, but they seem
to be outweighed by being unable to handle the nulls in either vb.net or c#.
I'd be curious to know how others are handling this problem (without using 0
or 1 or obscure data).
The problem is not reading the data from the table, but when changes are
made and you need to write it back, you need to know when a field is
supposed to be Null.
Thanks,
Tom