Hello,
I'm using a TableAdapter to update a table which has some default values set in SQL Server. However, every column that I leave blank gets inserted with a null value instead of the defined default value for the column.
Is there anything I am missing or is this the default behaviour
Thanks in advance for any help given.
Regards,
paulo

Update not writing default values to the database
Manfred Bjorlin
Set the DefaultValue property for each defaultable DataColumn in the DataTable instance(s) affected.
If that doesn't help, modify the INSERT and UPDATE T-SQL and add ISNULL() functions to ensure default values get written:
UPDATE tblMyTable SET MyCol1 = ISNULL(@MyCol1, 'Default value') WHERE MyTableID = @MyTableID;
Yatin
new2C#
Charles
haroldb
I'd like to know the answer on this question too.
Why DataTable Wizard doesn't import the default values automatically We have many tables with amount of fields between 10 to 150 and most of them have devault values. So, what do I suppose to do Copy/Paste for each field its default value
johnlm
acfalcon2001
vazi