Click here to Skip to main content
15,914,395 members
Home / Discussions / C#
   

C#

 
GeneralRe: Are C# versions tied to the IDE? Pin
charlieg1-Oct-12 4:06
charlieg1-Oct-12 4:06 
GeneralRe: Are C# versions tied to the IDE? Pin
Smart Arab1-Oct-12 5:46
Smart Arab1-Oct-12 5:46 
GeneralRe: Are C# versions tied to the IDE? Pin
charlieg1-Oct-12 9:17
charlieg1-Oct-12 9:17 
GeneralRe: Are C# versions tied to the IDE? Pin
Eddy Vluggen2-Oct-12 3:21
professionalEddy Vluggen2-Oct-12 3:21 
AnswerRe: Are C# versions tied to the IDE? Pin
BobJanova1-Oct-12 6:22
BobJanova1-Oct-12 6:22 
GeneralRe: Are C# versions tied to the IDE? Pin
charlieg1-Oct-12 9:16
charlieg1-Oct-12 9:16 
AnswerRe: Are C# versions tied to the IDE? Pin
Clifford Nelson1-Oct-12 12:24
Clifford Nelson1-Oct-12 12:24 
GeneralRe: Are C# versions tied to the IDE? Pin
Member 86976872-Oct-12 2:23
Member 86976872-Oct-12 2:23 
Questionfloat from bytes Pin
__John_1-Oct-12 1:01
__John_1-Oct-12 1:01 
AnswerRe: float from bytes Pin
OriginalGriff1-Oct-12 1:09
mveOriginalGriff1-Oct-12 1:09 
AnswerMessage Closed Pin
1-Oct-12 1:30
professionalAmarnath S1-Oct-12 1:30 
GeneralRe: float from bytes Pin
__John_1-Oct-12 1:55
__John_1-Oct-12 1:55 
GeneralRe: float from bytes Pin
BobJanova1-Oct-12 6:24
BobJanova1-Oct-12 6:24 
QuestionDraggable dynamic controls Pin
Shashank Srivastava1)1-Oct-12 0:52
Shashank Srivastava1)1-Oct-12 0:52 
AnswerRe: Draggable dynamic controls Pin
Kenneth Haugland1-Oct-12 0:59
mvaKenneth Haugland1-Oct-12 0:59 
GeneralRe: Draggable dynamic controls Pin
Shashank Srivastava1)1-Oct-12 1:08
Shashank Srivastava1)1-Oct-12 1:08 
GeneralRe: Draggable dynamic controls Pin
Shashank Srivastava1)1-Oct-12 2:07
Shashank Srivastava1)1-Oct-12 2:07 
GeneralRe: Draggable dynamic controls Pin
Pete O'Hanlon1-Oct-12 3:56
mvePete O'Hanlon1-Oct-12 3:56 
QuestionRead structured text file to listview in C #? Pin
Member 245846730-Sep-12 23:10
Member 245846730-Sep-12 23:10 
AnswerRe: Read structured text file to listview in C #? Pin
Smart Arab30-Sep-12 23:19
Smart Arab30-Sep-12 23:19 
AnswerRe: Read structured text file to listview in C #? Pin
Eddy Vluggen1-Oct-12 1:01
professionalEddy Vluggen1-Oct-12 1:01 
QuestionC# linq issue Pin
classy_dog30-Sep-12 20:00
classy_dog30-Sep-12 20:00 
AnswerRe: C# linq issue Pin
Pete O'Hanlon30-Sep-12 20:15
mvePete O'Hanlon30-Sep-12 20:15 
AnswerRe: C# linq issue Pin
DaveyM6930-Sep-12 22:54
professionalDaveyM6930-Sep-12 22:54 
AnswerRe: C# linq issue Pin
John Brett2-Oct-12 6:14
John Brett2-Oct-12 6:14 
DateTime is a ValueKind, so comparing it with null isn't very useful (it'll always not be null).
If your LINQ query doesn't find any rows, then FirstOrDefault() will return a default instance of the requested data type (DateTime, in this case).
There's a clue in the name Wink | ;)
If you want to know if you found any rows or not, either test the query first (e.g. Any()) before evaluating First(), or compare the returned value with the default DateTime value (DateTime.MinValue, IIRC). If you do that however, you won't be able to tell the difference between no rows, and rows where the first had the minimum datetime value.

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.