Hi all,
I'm looking for some best practices ideas on how to deal with adding new
values to a DataSet after I've pulled some data down.
The biggest issues I have are:
* AddRow adds everything with nulls
* I get no default values from the database
* The dataset updates propagate the nulls to the server so
even on the Insert that occurs the default values aren't set.
Short of manually executing Insert Statements and reading the data back is
there a better way to have the Dataset respect the database settings and
constraints defined in the database (SQL Server)?
Right now as it stands I have a routine that initializes most values to
non-null values then explicitly follow up the fields that need to have
specific values (or null) set. It's not a big deal, but this sort of thing seems very inefficient requriing lots of extra code... (well actually my BO has some code that can do this automatically setting everything to VFP style blanks rather than nulls).
Dealing with NULLS in ADO.NET is a PITA too because you have use DBNull for all comparisons etc. so I'm even less inclined to ever use NULLs in any data except those that REALLY require it for knowledge of previously unset values (most don't).
Any ideas?