DateTimePicker not updating dataset

  • Thread starter Thread starter LC
  • Start date Start date
L

LC

I am on the learn C#. Net in 695 day program.
I am just trying to learn stuff.
I have MSAccess database with 1 table called 'ParmDate' with 1 column
called 'ParmDate' which represents a date for which the rest of the
processing will be based.
I have a Windows Form with a DateTimePicker that is bound to this
MSAccess database and 'ParmDate' table and column.
I have a button on the form that when clicked will update the dataset.
I have a 'HasChanges' method that never detects changes in the dataset
from when I change the date in the DateTimePicker and hence never gets
updated to the database.

When I use a datagrid everything is fine. I am assuming that the logic
is the same for DateTimePicker.

Am I missing a command of some sort that will update the dataset and
then the database once I change the date in the DateTimePicker?
 
LC,

The datetime picker should correctly update the underlying dataset when
you change the date. I am curious, are you explicitly passing the dataset
back through the data adapter for updating though?
 
You were right. After spending several hours trying tol figure out how
the EndCurrentEdit works, then learning that I had the AcceptChanges
and DataAdapter Update commands in the wrong order, I finally got it to
work.

Thank you for your assistance.
 
Back
Top