473,850 Members | 2,248 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 2913
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
5048
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
2020
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. /// GetBindingTaskTypes() returns the types I want to use as a datasource in an arraylist.
6
6740
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
2046
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 the problem is raised. My database is an Access database. The table i am updating contains a Date...
2
5465
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
5697
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
6223
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 is good enough), then during database update, the date value is not saved to the database; while if...
4
2382
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 key in A) and other field holding a string.
2
13975
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
9741
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10666
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10724
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10351
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7071
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4546
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
2
4140
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.