質問

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)
役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top