Click here to Skip to main content
15,921,884 members
Home / Discussions / C#
   

C#

 
AnswerRe: Export data to excel sheet Pin
Jimmanuel18-Jun-07 3:48
Jimmanuel18-Jun-07 3:48 
GeneralRe: Export data to excel sheet Pin
HexaDeveloper21-Jun-07 2:17
HexaDeveloper21-Jun-07 2:17 
GeneralRe: Export data to excel sheet Pin
Jimmanuel21-Jun-07 2:23
Jimmanuel21-Jun-07 2:23 
QuestionComboBox change font on specific item.. Pin
akkram17-Jun-07 9:16
akkram17-Jun-07 9:16 
AnswerRe: ComboBox change font on specific item.. Pin
Dave Kreskowiak17-Jun-07 12:38
mveDave Kreskowiak17-Jun-07 12:38 
QuestionConnecting to FTP site Pin
frqftgbdafr17-Jun-07 9:01
frqftgbdafr17-Jun-07 9:01 
QuestionThe DateTime Value Type Pin
Brendan Vogt17-Jun-07 8:24
Brendan Vogt17-Jun-07 8:24 
AnswerRe: The DateTime Value Type Pin
Guffa17-Jun-07 8:54
Guffa17-Jun-07 8:54 
ma se wrote:
Is it possible to assign a null to a DateTime value type?


No, it's not.

You can only assign null to a reference, and as DateTime is a value type, there is no reference.

ma se wrote:
If not, what then?


If you are using framework 2.x, you can use the nullable types:

DateTime? when;
if (something) {
   when = null;
} else {
   when = DateTime.UtcNow;
}
if (when.HasValue) {
   Console.WriteLine(when.Value.ToString("yyyy-MM-dd"));
} else {
   Console.WriteLine("No time specified.");
}


If you are using framework 1.x, you have to do something else to keep track of when there is a value or not, like using a bool variable along with the DateTime variable.

---
single minded; short sighted; long gone;

QuestionRe: The DateTime Value Type Pin
Brendan Vogt17-Jun-07 9:03
Brendan Vogt17-Jun-07 9:03 
AnswerRe: The DateTime Value Type Pin
User 665817-Jun-07 9:11
User 665817-Jun-07 9:11 
AnswerRe: The DateTime Value Type Pin
Luc Pattyn17-Jun-07 9:34
sitebuilderLuc Pattyn17-Jun-07 9:34 
GeneralRe: The DateTime Value Type Pin
PIEBALDconsult17-Jun-07 14:45
mvePIEBALDconsult17-Jun-07 14:45 
QuestionCreating list of method execution time Pin
AndrusM17-Jun-07 5:10
AndrusM17-Jun-07 5:10 
AnswerRe: Creating list of method execution time Pin
Guffa17-Jun-07 7:05
Guffa17-Jun-07 7:05 
GeneralRe: Creating list of method execution time Pin
AndrusM18-Jun-07 3:07
AndrusM18-Jun-07 3:07 
AnswerRe: Creating list of method execution time Pin
User 665817-Jun-07 7:34
User 665817-Jun-07 7:34 
QuestionHow can I search for a record without using Primary key Pin
Jon Stroh17-Jun-07 4:39
Jon Stroh17-Jun-07 4:39 
AnswerRe: How can I search for a record without using Primary key Pin
WillemM17-Jun-07 8:15
WillemM17-Jun-07 8:15 
QuestionRe: How can I search for a record without using Primary key Pin
Jon Stroh18-Jun-07 2:35
Jon Stroh18-Jun-07 2:35 
QuestionCustom User Control and Repeater Pin
Expert Coming17-Jun-07 4:34
Expert Coming17-Jun-07 4:34 
AnswerRe: Custom User Control and Repeater Pin
Expert Coming17-Jun-07 16:58
Expert Coming17-Jun-07 16:58 
QuestionHiding a form in Vista Pin
Mr Jen Withers17-Jun-07 3:37
Mr Jen Withers17-Jun-07 3:37 
Questiondatagridview - VB.net 2005 ,sql server 2005 Pin
nilam1117-Jun-07 2:36
nilam1117-Jun-07 2:36 
AnswerRe: datagridview - VB.net 2005 ,sql server 2005 Pin
Arun.Immanuel17-Jun-07 2:45
Arun.Immanuel17-Jun-07 2:45 
AnswerRe: datagridview - VB.net 2005 ,sql server 2005 Pin
Sathesh Sakthivel17-Jun-07 3:47
Sathesh Sakthivel17-Jun-07 3:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.