Solved

DateTimePicker Binding

Posted on 2012-04-03
1
269 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 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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