?
Solved

DateTimePicker Binding

Posted on 2012-04-03
1
Medium Priority
?
270 Views
Last Modified: 2012-06-21
Hi,

I know this has been asked before but I still cannot find a solution from the previous posts (missing links to external articles and so on)

I have some dateTimePickers binding to fields in a database. Their default values are set to todays date, the problem is if someone doesn't physically select the date with the mouse, today's date is not recorded in the database, I know I could initially make them blank to force the user to select a date but I would rather it records today's date if no selection is made

Is this possible?

Thank you
0
Comment
Question by:FCapo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 38

Accepted Solution

by:
PaulHews earned 1500 total points
ID: 37803114
I think the problem is that the new record has a null field for the date value that is bound to the datetimepicker, but the datetimepicker cannot display/bind to a null value.  If you want today's date to be saved automatically, you should set the field to equal today's date when you load the form.  Then the binding should work if the user selects a different value.  You would not be able to enter a null value if the field is supposed to be nullable, however.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question