A
Adam Clauss
So, we originally wrote our application to use Oracle. As such, we used
specifically declared OracleConnection and use ":" for naming parameters.
Ex:
SELECT * FROM sometable where somefield = :fieldValue
Now, we have a need to port the code to SQL server for another client. I'm
thinking we should do this the "right" way this time, and abstract things
back to IDbConnection rather than OracleConnection or SqlConnection. Then,
we can simply change what type of objects get created, and not the
declarations of usage.
This is good.
What is bad is parameters - Oracle parameters begin wtih ":" whereas SQL
server requires them to be "@". But there does not seem to be a "generic"
way of handling this if we were to abstract back to the interfaces and have
the SQL be compatible with different types of servers. Am I missing a way
to do this?
Thanks!
specifically declared OracleConnection and use ":" for naming parameters.
Ex:
SELECT * FROM sometable where somefield = :fieldValue
Now, we have a need to port the code to SQL server for another client. I'm
thinking we should do this the "right" way this time, and abstract things
back to IDbConnection rather than OracleConnection or SqlConnection. Then,
we can simply change what type of objects get created, and not the
declarations of usage.
This is good.
What is bad is parameters - Oracle parameters begin wtih ":" whereas SQL
server requires them to be "@". But there does not seem to be a "generic"
way of handling this if we were to abstract back to the interfaces and have
the SQL be compatible with different types of servers. Am I missing a way
to do this?
Thanks!