Question

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)
Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top