PC Review


Reply
Thread Tools Rate Thread

Default Values

 
 
JMM B
Guest
Posts: n/a
 
      10th Sep 2004
When doing the update of a dataset with added rows, passing null values
to columns that contain DEFAULT value defined in the DataBase, I don't
get the default value back with the updated DataSet. In fact, it inserts
null values in the database. I tried to modify the schema of the table
to change this behaviour, but it seems to not work.

thanks,



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      10th Sep 2004
To use the database-defined default, you have to supply NO value to the
UPDATE for this column--not NULL.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"JMM B" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> When doing the update of a dataset with added rows, passing null values
> to columns that contain DEFAULT value defined in the DataBase, I don't
> get the default value back with the updated DataSet. In fact, it inserts
> null values in the database. I tried to modify the schema of the table
> to change this behaviour, but it seems to not work.
>
> thanks,
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
JMM B
Guest
Posts: n/a
 
      14th Sep 2004
Ok, but how can I send NO values to the UPDATE. In the xml schema of the
Dataset, there is a property called "NullValue" with three possible
values: null, empty, throw. I set it to "empty" but still inserts null
values in the database.
I didn't manage to make it work.
thanks,


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      14th Sep 2004
First, table-defined default values are applied when a data row is INSERTED,
not UPDATED--and then only when the INSERT statement does not supply the
explicit value.

When using a stored procedure that executes an UPDATE, the procedure can
define any number of parameters that can have default values. When executing
the stored procedure with ADO and want the parameter to be set to this
default value, you simply build a Parameters collection that does not
include the Parameter.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"JMM B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Ok, but how can I send NO values to the UPDATE. In the xml schema of the
> Dataset, there is a property called "NullValue" with three possible
> values: null, empty, throw. I set it to "empty" but still inserts null
> values in the database.
> I didn't manage to make it work.
> thanks,
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table fields:- Setting default values to be based on other field values Rob W Microsoft Access 3 20th Feb 2008 09:51 PM
default values Jean-Paul De Winter Microsoft Excel Discussion 8 14th Feb 2007 12:26 AM
Default values in .Default user Shell Folders ? Michel S. Windows XP Help 2 19th Jul 2005 08:52 PM
Default values from one table, entered values in another =?Utf-8?B?bGFzZXIwMjkxMA==?= Microsoft Access Forms 2 21st Jun 2005 11:01 PM
Default values? Lovelock, David Microsoft Excel Misc 2 26th Nov 2003 01:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:47 PM.