A
Avanti
I have a date property in the class and I wanted to assign it a min date.
Public class test
Public Property CreatedBy() As String
Get
Return mCreatedBy
End Get
Set(ByVal Value As String)
mCreatedBy = Value
End Set
End Property
Public Property StartDate() As Date
Get
Return mStartDate
End Get
Set(ByVal Value As Date)
mStartDate = Value
End Set
End Property
end class
<Root>
<row name='name1' testDate='' />
<row name='name1' testDate='2/12/04' />
</Root>
I have an xml and I wanted to be able to assign the values to the
properties.
If I have a date that has a "" value in xml how do I initialize the date
property
If I do
objclassTest.StartDate =
IIf(IsDate(objnode.Attributes.GetNamedItem("testDate").Value.ToString),
CType(objnode.Attributes.GetNamedItem("testDate").Value.ToString, Date),
Date.MinValue.ToShortDateString)
I get the error invalid cast from string "" to date.
Please help how do I do this.
Thanks,
Pranav
Public class test
Public Property CreatedBy() As String
Get
Return mCreatedBy
End Get
Set(ByVal Value As String)
mCreatedBy = Value
End Set
End Property
Public Property StartDate() As Date
Get
Return mStartDate
End Get
Set(ByVal Value As Date)
mStartDate = Value
End Set
End Property
end class
<Root>
<row name='name1' testDate='' />
<row name='name1' testDate='2/12/04' />
</Root>
I have an xml and I wanted to be able to assign the values to the
properties.
If I have a date that has a "" value in xml how do I initialize the date
property
If I do
objclassTest.StartDate =
IIf(IsDate(objnode.Attributes.GetNamedItem("testDate").Value.ToString),
CType(objnode.Attributes.GetNamedItem("testDate").Value.ToString, Date),
Date.MinValue.ToShortDateString)
I get the error invalid cast from string "" to date.
Please help how do I do this.
Thanks,
Pranav