I'm having an issue with passing values from text boxes through to
the fill subroutines on my dataTableAdaptors.

Basically this is a simple example that illustrates my issue



     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

         MsgBox((Nothing = "").ToString) 'Returns "True"
         MsgBox(dostuff(Nothing)) 'Returns "not a date"
         MsgBox(dostuff("")) 'Throws Exception - Conversion from string
"" to type 'Date' is not valid.

      End Sub

     Function dostuff(ByVal aDate As System.Nullable(Of Date)) As String

         If aDate.HasValue Then
             Return CType(aDate, Date).ToShortDateString
         Else
             Return "not a date"
         End If

     End Function

I'm unsure what to do here, I tried to create a function to converts
empty strings to Nothing and execute that before passing the values of
the text boxes to the fill functions but that produces the same error.

Thanks in advance,

Joel




[Non-text portions of this message have been removed]





SPONSORED LINKS
Object oriented Programming languages


YAHOO! GROUPS LINKS




Reply via email to