Pergunta

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)
Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top