G
Guest
I have a text box on a form “txtExamDate†that I know contains nothing. I am
trying to test code that will determine the text box is nothing. I am
getting the error because there is no value in the field and I am assigning
it to a date field. My question is: How do I get the If statement to work?
Exception Details: System.FormatException: String was not recognized as a
valid DateTime
Line 723: If TypeOf txtExamDate.Text Is DBNull Then
Line 724: Else
Line 725: patientRow.ExamDate =
DateTime.Parse(txtExamDate.Text)
Line 726: End If
Source File: c:\inetpub\wwwroot\STD\Patient_Detail.aspx.vb Line: 725
trying to test code that will determine the text box is nothing. I am
getting the error because there is no value in the field and I am assigning
it to a date field. My question is: How do I get the If statement to work?
Exception Details: System.FormatException: String was not recognized as a
valid DateTime
Line 723: If TypeOf txtExamDate.Text Is DBNull Then
Line 724: Else
Line 725: patientRow.ExamDate =
DateTime.Parse(txtExamDate.Text)
Line 726: End If
Source File: c:\inetpub\wwwroot\STD\Patient_Detail.aspx.vb Line: 725