Tuesday, August 20, 2013

SqlParameters should be called differently considering whether or not one is talking to MSSQL or Oracle.

The @ (at symbol) in an MSSQL SqlParameter should be a : (colon) in a Oracle-friendly SqlParameter. It is important to hand in types that are not strings as SqlParameters when writing code that could swap between both Oracle and MSSQL. Let a adapter talking to the database string encode a DateTime for instance, do not try to be too smart and do this yourself.

No comments:

Post a Comment