Frage

Im looking to convert a DateTime to an Oracle DateTime (to pass to an Oracle stored proc.) I was thinking of using what's below in a general conversions class I have but I'm not sure how to return the converted date, could anyone kick me in the right direction?

thanks

public static explicit operator OracleDateTime(DateTime dt)
War es hilfreich?

Lösung

Well that operator means you can just cast:

DateTime input = new DateTime(...);
OracleDateTime result = (OracleDateTime) input;
...

It's not clear what you mean by "how to return the converted date" - it's not like you'd want a method for this, given that it's already been implemented for you.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top