By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,089 Members | 1,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,089 IT Pros & Developers. It's quick & easy.

DateTimePicker not updating dataset

P: n/a
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?

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"LC" <lo************@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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?

Nov 17 '05 #2

P: n/a
LC
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.

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.