|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Assigning a Null to Datetime Variable or ObjectI need a solution to assign a Null to a Datetime Variable / Object. Am willing to know whether it is possible? I will appreciate you if any one knows the solution for it . The Situation is I like to store a Date in the Object when the User enters the Date. If he doesn't enters anything then i like to store Null inorder to use that in my Validation. Note: I have n't used the Date time Control for entering the Date rather i used the Textbox to enter the Date. But the Object's Date Type is Datetime. Let me know if anyone helps me thanks Solution Seeker Solution Seeker wrote:
> I like to store a Date in the Object when the User enters the Date. I have approached this by using "DateTime.MinValue" as a placeholder for a > If he doesn't enters anything then i like to store Null inorder to > use that in my Validation. null date. Anywhere I want to store a blank date value in a Date variable, I'll store DateTime.MinValue. Anywhere I want to check to see whether a date is blank or not I'll compare it to DateTime.MinValue. This has worked very well in my application. Hope that helps, -- (O)enone "Solution Seeker" <Solution See***@discussions.microsoft.com> schrieb: 'Date' is a value type and cannot be 'Nothing'. Take a look at the > I need a solution to assign a Null to a Datetime Variable / Object. 'SqlDateTime' data type, which supports 'NULL' values. .NET 2.0 will support nullable types. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
ASCII lookup table
Datagrid resizing rows on sort - not wanted complex grid with comboboxes Datagrid - shown vertically instead of horizontally? Reading from a ini-file and run a program Easy one about web forms How do I measure the time it takes to copy a file? step by step guide to databinding? Positioning a Web Control - Runtime Registering my program as default for my file extension |
|||||||||||||||||||||||