Jun 6, 2005 #1 ionutdinulescu Programmer Joined Jun 11, 2002 Messages 59 Location GB I have a DataRow dr variable. I would like to check if dr(i) is of type DateTime. How can I do this ?
I have a DataRow dr variable. I would like to check if dr(i) is of type DateTime. How can I do this ?
Jun 7, 2005 Thread starter #2 ionutdinulescu Programmer Joined Jun 11, 2002 Messages 59 Location GB I have tried the following If (dr(0).GetType.ToString = "System.DateTime") Then lv.SubItems.Add(dr(0).Date) end if The first line of code seems to work fine (it recognizes the date fields(, but the second one gives Null reference exception. Do you have any idea ? Upvote 0 Downvote
I have tried the following If (dr(0).GetType.ToString = "System.DateTime") Then lv.SubItems.Add(dr(0).Date) end if The first line of code seems to work fine (it recognizes the date fields(, but the second one gives Null reference exception. Do you have any idea ?
Jun 7, 2005 #3 chrissie1 Programmer Joined Aug 12, 2002 Messages 4,517 Location BE what is this line suppossed to do dr(0).Date Christiaan Baes Belgium If you want to get an answer read this FAQ faq796-2540 There's no such thing as a winnable war - Sting Upvote 0 Downvote
what is this line suppossed to do dr(0).Date Christiaan Baes Belgium If you want to get an answer read this FAQ faq796-2540 There's no such thing as a winnable war - Sting
Jun 7, 2005 Thread starter #4 ionutdinulescu Programmer Joined Jun 11, 2002 Messages 59 Location GB I try to get the date component of the datetime object Upvote 0 Downvote
Jun 7, 2005 #5 chrissie1 Programmer Joined Aug 12, 2002 Messages 4,517 Location BE Code: cdate (dr(0)) perhaps? Christiaan Baes Belgium If you want to get an answer read this FAQ faq796-2540 There's no such thing as a winnable war - Sting Upvote 0 Downvote
Code: cdate (dr(0)) perhaps? Christiaan Baes Belgium If you want to get an answer read this FAQ faq796-2540 There's no such thing as a winnable war - Sting