473,549 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DateTimePicker not updating dataset

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
2 2895
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.co m

"LC" <lo************ @hotmail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
5031
by: Ed Crowley | last post by:
I have a DateTimePicker control on my form that is displaying the date format in UK format (dd/mm/yy). However, in my code dtpStartDate.Value gives a date in US format, but dtpStartDate.Value.ToString() gives the date in the required UK format! Any ideas? All system locale settings are set to British/UK settings.
0
1997
by: Uchiha Jax | last post by:
When using a strongly typed dataset (generated from the Visual Studio IDE from an XSD file) and databinding I get a really odd error when binding to both a combox and a datetimepicker. I bind like the following: //// tDs is the strongly typed dataset, //// tDs.TheTask returns a strongly typed row from one of the tables. ///...
6
6723
by: eye5600 | last post by:
Is there a cure for the problems using databinding with a DateTimePicker? I find that a) sometimes it works, sometimes it doesn't, and b) it fails silently causing all databinding on the DataSet to fail with a error message. Help!
5
2016
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where...
2
5449
by: Austin T | last post by:
I have a datetimepicker called say mydteTimePicker and it is bound to a dataset. However the the dataset value is null the datetimepicker displays today's date as the default. I would like it to display a blank if there is no date. Any ideas on how to do this Thank yo Austin
10
5642
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1) DsStudentCourse1.AcceptChanges() i'm also wondering because w/ out AcceptChanges the data is still save into the database and it is now faster.
7
6191
by: Clamara | last post by:
When adding a new record from my form, I pre-set my DateTimePicker's value to System.DateTime.Today Since the "Today" value is used most of the time, the user doesn't need to select a date from the DateTimePicker, since the default is shown. My problem is, if the user does not choose a value from the DateTimePicker (because using the default...
4
2364
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has two fields: a primary key and another holding a string. In table B there are three fields: a primary key, a foreign key (which links to the primary...
2
13943
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
0
7464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7979
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7826
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6065
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5385
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5107
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1960
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.