GetDate in Dataset

  • Thread starter Thread starter Stefano Meier
  • Start date Start date
S

Stefano Meier

I have a dataset with a DateTime field, each time i make an update i have to
update also that field with the actual date time, but with the DB date and
time,
somthing like:

UPDATE mytable SET datechanged=GETDATE() WHERE id=....

It's possible by setting something in the dataset or i have to change the
updatecommand of the dataadapter?
 
If you do it in DataSet then the value will be the system date of the client
machine at the point the record is updated in the dataset.

If you do it in the UpdateCommand of the DataAdapter then the value will be
the system date of the machine where the database resides at the point the
record is updated to the database.

It really boils down to choice.

The example you have shown would definitely required modification of the
UpdateCommand of the DataAdapter.
 
Thank's, it was what i thought.

Stephany Young said:
If you do it in DataSet then the value will be the system date of the client
machine at the point the record is updated in the dataset.

If you do it in the UpdateCommand of the DataAdapter then the value will be
the system date of the machine where the database resides at the point the
record is updated to the database.

It really boils down to choice.

The example you have shown would definitely required modification of the
UpdateCommand of the DataAdapter.

have
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top