<sigh> :^)
You turn on Option Strict to discover where you are making implicit castings
at. And that is exaclty what it did.
Public pubLatest As Date
pubLatest =
FormatDateTime(Me.SqlSelectCommand1.Parameters("@pubLatest").Value,
DateFormat.ShortDate)
Gives me error: "Option Strict On disallows implicit conversions from
'System.Object' to 'Date'."
Like I said, you are trying to shove a string (the result of either function
is a string, not a date) into a date variable. Hence "Option Strict On
disallows implicit conversions from 'System.Object' to 'Date'."
Don't do that!
If you want to display a date variable (pubLatest), then you must convert it
to a string (using either method). Both of the functions return a STRING,
not a DATE. So you cannot store it back into a DATE variable. (Well, you
can with Option strict off, but it is just casting it back to a DATE
implicitly.)
Make a new variable (say "s")
Public s As String
s = FormatDateTime(Me.SqlSelectCommand1.Parameters("@pubLatest").Value,
DateFormat.ShortDate)
Now use "s" to display it your date variable as a formatted string.
Debug.Writeline(s)
Greg