Hi,
I am having a problem turning nothing into a datetime. Here is the line I am using:
VB Code:
Dim DtApproved As DateTime = IIf(Me.lblRtngApprovedDate.Text = "", DateTime.MinValue, CType(Me.lblRtngApprovedDate.Text, DateTime))
The date is stored as the text of a label (that's just the way it is, I didn't design this, I just gotta work with it). So, if the text = "", I want DtApproved to equal DateTime.MinValue, else I want it to convert the text in the label to a date.
The second part is working, but it is crashing when the label's text equals "". Any ideas on how to fix this?
Thanks to all




Reply With Quote