R
Rookie Card
I know this is a very common issue but cannot find a thread that
resolves the issue.
I need to re-format my dates to "MMM d, yyyy". The problem I have is I
have an MSSQL database that allows <NULLS>.
I'm using this code to format the dates:
<%# IIF((dsCase.FieldValue("inj_beg", Container) <>
nothing),DateTime.Parse(dsCase.FieldValue("inj_beg",
Container)).ToString("MMM d, yyyy"), "") %>
It works well until it evaluates a <NULL> date value. The code above
still evaluates the <NULL> as true and tries to parse the <NULL> value
which throws the exception:
String was not recognized as a valid DateTime
I've been stuck on this one for over 10 hours...
Please Help! I send you a case of beer.
Thanks so much
gary (rockie card)
resolves the issue.
I need to re-format my dates to "MMM d, yyyy". The problem I have is I
have an MSSQL database that allows <NULLS>.
I'm using this code to format the dates:
<%# IIF((dsCase.FieldValue("inj_beg", Container) <>
nothing),DateTime.Parse(dsCase.FieldValue("inj_beg",
Container)).ToString("MMM d, yyyy"), "") %>
It works well until it evaluates a <NULL> date value. The code above
still evaluates the <NULL> as true and tries to parse the <NULL> value
which throws the exception:
String was not recognized as a valid DateTime
I've been stuck on this one for over 10 hours...
Please Help! I send you a case of beer.
Thanks so much
gary (rockie card)