473,320 Members | 1,950 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,320 software developers and data experts.

DateTimePicker and Null Values

Hello all:

Does anyone happen to know the best way to handle null values for
DateTimePickers? We have quite a few columns in our db that will not
necissarily have a date for certain entries. How do you allow for this?
I have tried to send a null string to the dataset but it requires a
value type of DateTime.

Thanks,

- John -
Nov 17 '05 #1
3 3237
VJ
You have to have some a value like 1/1/1900 or something & treat it as
null...in your code.. Thats what we have done..

VJ

"John Smith" <oh******@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
Hello all:

Does anyone happen to know the best way to handle null values for
DateTimePickers? We have quite a few columns in our db that will not
necissarily have a date for certain entries. How do you allow for this? I
have tried to send a null string to the dataset but it requires a value
type of DateTime.

Thanks,

- John -

Nov 17 '05 #2
If you're using Visual Studio, open up Server Explorer and navigate to the
table. Right-click on the table and select "Design Table". you will then
see a design view of your table with a column called "Allow nulls". Put a
check in the box for the date column and that should solve your problem...
hopefully.

cashdeskmac

"John Smith" wrote:
Hello all:

Does anyone happen to know the best way to handle null values for
DateTimePickers? We have quite a few columns in our db that will not
necissarily have a date for certain entries. How do you allow for this?
I have tried to send a null string to the dataset but it requires a
value type of DateTime.

Thanks,

- John -

Nov 17 '05 #3
On Thu, 24 Mar 2005 15:56:14 -0800, John Smith wrote:
Hello all:

Does anyone happen to know the best way to handle null values for
DateTimePickers? We have quite a few columns in our db that will not
necissarily have a date for certain entries. How do you allow for this?
I have tried to send a null string to the dataset but it requires a
value type of DateTime.

Thanks,

- John -


Have a look at this control from Alexander Shirshov:
http://www.omnitalented.com/Blog/Per...070934dc8.aspx

It extends the DateTimePcker control with nullabel functionality and it's
open source.

--
Claudio Grazioli
http://www.grazioli.ch
Nov 17 '05 #4

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

Similar topics

1
by: Marcus | last post by:
Hello, quick question about MySQL storing NULL values... Say I have a textbox called $_POST and a variable $var. if(empty($_POST)) $var = NULL; else $var = $_POST; Disregarding...
26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
8
by: manning_news | last post by:
Using SQL2000. According to Books Online, the avg aggregrate function ignores null values. ((3+3+3+3+Null)/5) predictably returns Null. Is there a function to ignore the Null entry, adjust the...
3
by: JOEP | last post by:
What do I need to do to allow an append query to post null values to records in a field of the destination table? Basically I want to allow records with null values to post to the table. The append...
0
by: John Smith | last post by:
Hey folks, How can I get the DateTimePicker not to default to todays date when you don't specify a value (or if you specify an "" or null as its value)? It represents a field in my database...
3
by: Rico | last post by:
Hello, I have a foreign key constraint between two tables (Appointments and MissedAppointmentReasons) and I'd like to allow null values in Appointments table for the field containing the...
0
by: gp | last post by:
I am and have been using PDO for about a year now...and have finally gotten around to solving the "DB NULL value" issues I ran into early on... I am looking for suggestions and techniques to...
10
by: Toby Gallier | last post by:
Hello! I have a form that is calculating averages as follows: " =(NZ()+Nz()+Nz())/3 " However I need to now adjust for null values , so for example if value2 is null I would then need to...
10
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have the following three files. 1. Users.aspx is a webpage that uses the <asp:ObjectDataSourcecontrol to populate a simple <asp:ListBoxcontrol. 2. The UserDetails.cs file creates a Namespace...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.