473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Date Picker

Hi All,
I am developing an application in VB.net. I am using .Net Datetime
picker control to manage the date. But I am not able to assign null/Empty
value to the control. I found the property "Checked" to work with this
control..But I cannot use this property for making null dates..
Is there any way to solve this problem?.

Expecting any help or suggestions?

Regards,
Rethish
Nov 20 '05 #1
4 18932
"Rethish" <r_*******@msn.com> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
Hi All,
I am developing an application in VB.net. I am using .Net Datetime
picker control to manage the date. But I am not able to assign null/Empty
value to the control. I found the property "Checked" to work with this
control..But I cannot use this property for making null dates..
Is there any way to solve this problem?.

Expecting any help or suggestions?

What is a "Null" date? ... 1932 1:30 am, 2003 2:39 pm? What is a "Null"
Integer? The point is that DateTime (and Date) is a structure in .NET, not a
Class. This means that there is no true "Null" or Nothing state for the
object, there is only an initial state: 1/1/1900 12:00 AM. So if the object
is = the initial state, then it is empty. You can get around this by
setting the date = New Date( ) or by using the Checked property.

'// Check for a "null" or empty date:
If DateTimeControl.Value.Equals(New Date()) Then
'// the date is empty/null/nothing
End If

'// Set a null/empty date:
DateTimeControl.Value = New Date( )
HTH

~
Jeremy
Nov 20 '05 #2
Hello,

"Rethish" <r_*******@msn.com> schrieb:
I am developing an application in VB.net. I am using .Net
Datetime picker control to manage the date. But I am not
able to assign null/Empty value to the control. I found the
property "Checked" to work with this control..But I
cannot use this property for making null dates..


Set the 'ShowCheckBox' property to 'True'. If the checkbox is unchecked,
the control can be treated as empty.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
Hi Jeremy,
When I am trying to set the date as empty for the DateTime picker, I got
the error like the date should be in between min and Max date of the date
picker.
How can I assign DateTimeControl.Value = New Date( ) for a date picker..?

Rethish

"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote in message
news:nw*********************@twister.tampabay.rr.c om...
"Rethish" <r_*******@msn.com> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
Hi All,
I am developing an application in VB.net. I am using .Net Datetime
picker control to manage the date. But I am not able to assign null/Empty value to the control. I found the property "Checked" to work with this
control..But I cannot use this property for making null dates..
Is there any way to solve this problem?.

Expecting any help or suggestions?

What is a "Null" date? ... 1932 1:30 am, 2003 2:39 pm? What is a "Null"
Integer? The point is that DateTime (and Date) is a structure in .NET, not

a Class. This means that there is no true "Null" or Nothing state for the
object, there is only an initial state: 1/1/1900 12:00 AM. So if the object is = the initial state, then it is empty. You can get around this by
setting the date = New Date( ) or by using the Checked property.

'// Check for a "null" or empty date:
If DateTimeControl.Value.Equals(New Date()) Then
'// the date is empty/null/nothing
End If

'// Set a null/empty date:
DateTimeControl.Value = New Date( )
HTH

~
Jeremy

Nov 20 '05 #4
"Rethish" <r_*******@msn.com> schrieb
Hi Jeremy,
When I am trying to set the date as empty for the DateTime
picker, I got
the error like the date should be in between min and Max date of the
date picker.
How can I assign DateTimeControl.Value = New Date( ) for a date
picker..?


I haven't used the DateTimePicker yet, and maybe the question is better for

microsoft.public.dotnet.framework.windowsforms.con trols

(because it is not VB.NET specific) but I'd say that the statement
concerning min/max dates should be followed. Whenever you create a new Date,
the default value is the 1st of january in the year 0001. That's probably
not in the range from DateTimePicker.MinDate to DateTimePicker.MaxDate.
--
Armin

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Adrian Parker | last post by:
Hi. I have a date time picker in my program which uses ADO to read from an Access database. It works perfectly, unless the database is empty (no records) when opened. When you try to open an...
13
by: Hussein Patwa | last post by:
Hi there. I'm new to this group. I'm also partially sighted so navigating the web is sometimes quite difficult. I'm looking for a javascript date picker, you know the ones that travel sites...
26
by: sgershon | last post by:
Hi. I know this is should be a simple question. I know server-side web-programming, and never needed to use client-side scripting... until now :) I have done so far a little number of scripts...
13
by: Deano | last post by:
Hi, I generate a report using two dates (From and To). I notice if I enter 01/10/2003 that it is interpreted by Access as 10/01/2003 i.e 10th January rather than 1st October as I intended. ...
4
by: Michael Turner | last post by:
Hi Guys I have two DateTime pickers one shows the Date and the other the time, this is a requirement of the solution. The problem I have is that when the time is saved to the sql database into a...
4
by: Michel Posseth [MCP] | last post by:
I have a problem with the date time picker validate event wich i believe is a bug How to reproduce : throw on a form a date time picker control and a textbox control select the validating...
0
by: fredloh | last post by:
i have a tab control on my form. i then have several microsoft date and time picker control on the tab control. when i select a date on any of the date and time picker control, the result of the...
1
by: vp.softverm | last post by:
hi all . Am facing problem with the date picker. when i click on date picker in a popup window. the date table is opened in the middle of the pop up window. and it is unable to scroll with...
1
by: Bobby | last post by:
Hi, I'm using Office 2007. I have a text field called txtDate which is formatted to medium date. This gives me the date picker when the control has the focus. I have several other text controls...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.