[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

date time picker null value

Posted on 2006-05-14
3
Medium Priority
?
639 Views
Last Modified: 2008-01-09
Hi

I am having trouble using the DateTimePicker control.  

I basically want to print out each time a user choses a date.  So I use the ValueChanged event.  

However everytime I run my program, the DateTimePicker starts with a null value.  I found this out by just having a messagebox display the dateTimePickerControl.value.

I have the Control on a panel that is not initially visible, so only when I change to that panel is where the right date gets displayed.

Since it is a null value any other methods that I run because of a date change crash my program.  

I was thinking of creating the control dynamically, but I was wondering if there was another way?
0
Comment
Question by:foobarr
3 Comments
 
LVL 7

Author Comment

by:foobarr
ID: 16679416
Well I change the messagebox to print out the Value of the control and it worked fine...but it only displays the date and time a generic way

I need it formatted to yyyy-MM-dd cuz i'm using mysql so I need to use the control.text which gives me a null value when loading hte program up
0
 
LVL 10

Assisted Solution

by:heintalus
heintalus earned 750 total points
ID: 16679489
Just use the ToSting function & pass it the format you want
i.e.
dateTimePickerControl.Value.ToString("yyyy-MM-dd")
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 750 total points
ID: 16681096
Hi foobarr,

See my article of January 2005 at http://emoreau.s2i.com/

Cheers!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 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