473,402 Members | 2,046 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,402 software developers and data experts.

Need confirmation: Checking a Datetime for null

Unlike objects for which you can check null, the DateTime is a structure for
which you can't. The way I have been doing this is:

if (myDatetime == Convert.ToDateTime(Null))
{
....
}

Which is long way of doing

if (myDatetime == System.DateTime.MinValue)
{
...
}

I wanted to opinions on what's more acceptable way of DateTime comparison.
In my opinion, the first one, although long, is meaningful. Thanks!

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com

Nov 17 '05 #1
0 698

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

Similar topics

2
by: David Heller | last post by:
I have this schema I exported from a database running mysql version 4.01 I'm trying to create this table on a server running mysql 3.23 I keep getting a syntax error near line 11 (I added the line...
12
by: Vicky | last post by:
What is the better way of checking blank string is it strvar.lenght > 0 or strvar == "" or something else Thnaks
2
by: glenn | last post by:
Hi folks, I guess this question has to do with formatting dates. Seems like it should be a no brainer but have spent too much time hunting so I am posting the forum. I have a function that...
5
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
2
by: rhaazy | last post by:
using mssql 2000... Table Def... CREATE TABLE . ( IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
6
by: Designing Solutions WD | last post by:
I have the following table. GO /****** Object: Table . Script Date: 05/01/2007 10:42:31 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
4
by: kyle.fitzgerald | last post by:
I'm just know basic SQL but not enough to write any complex queries. The problem I'm facing right now keeps me thinking to use a Cursor but I've seen a lot of posts on here saying Cursors are bad...
4
by: ITCraze | last post by:
Hello everyone, I have a Gridview , whose first column is template colums which contains checkboxes , outside my GridView I a have a delete button. So in this application,when the user check...
3
by: shapper | last post by:
Hello, On an ASP.NET MVC project I am getting a list of Tags which names start with a string contained on the variable "q". Everything works fine if no Post is related to Tags. When there is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.