I have two short questions (I'm using VB):
1. How do I send honest to goodness real NULL values back to my database
2. How do I perform update/inserts when I haven't provided values for every column in the underlying database table.
What follows is theoretical/philosophical discussion and may be safely ignored.
With respect to the first question, I don't want to start a holy war on the meaning of null values but... I think null values mean one thing and zero-length strings mean something else. The classic example is middle names. IMHO, a null value in the middle name field means the HR person forgot to ask, i.e. we have no clue whether the employee has a middle name, let alone what it might be. A zero-length string means HR asked and the employee does not have, or refused to give, a middle name.
Regardless, I know how to "de-null" a value before passing it to a strongly typed tableadapter so that I don't get a StrongTypingException. I want to know how to actually pass the null value.
I suppose question 2 is a variant of question 1 in that all those unaccounted for columns are all nulls. In any event, in the real world (I hope), what the user sees and how she interacts with my web application should not dictate how I store the resulting data in the underlying database. Good database design practice should inform the latter while business logic, aesthetics, and other considerations should dictate the former. In particular, I don't see any reason why a given table should receive data from only one form. Conversely, any given form need not reflect all the columns available in the underlying database table. So far as I can tell, however, a TableAdapter requires me to "touch" every column. On the one hand, I'm lazy and don't want to type a bunch of TableRow columns = "" (or my null values from above
). On the other hand, it seems bad coding in that it implies that those columns have something to do with the given ASPX page when they do not. Imagine the poor guy coming after me who has to figure out why all those columns are there!
I have a third question: Is this too much yakking
Thanks for any help.
Randy

Sending Nulls Back to Database
EW