I have a function that have parameter for DateTime
AddNewRowToTable(....,DateTime ExpDate)
when I call that method like this below:
AddNewRowToTable(....,"2008/04/14")
It said it can't convert string
to DateTime
.
help!
You have to do AddNewRow(....,new DateTime(..))
or AddNewRow(....,DateTime.ParseExact(dateString, format, provider))
There is no implicit conversion from string
You will have to convert the string
to type DateTime
. You can convert it in this way:
AddNewRow(....,new DateTime.ParseExact("2009-05-08", "yyyy-MM-dd",
System.Globalization.CultureInfo.InvariantCulture))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With