?
=?iso-8859-1?Q?Norbert_P=FCrringer?=
Hello!
Is there an advantage of using parameter objects instead of using
concatenated command strings?
Example
1) use of parameter object:
OracleCommand cmd = new OracleCommand("SELECT PROJECT FROM USERS.LOGIN WHERE
UPPER(SESSIONID)=:SESSIONID", _con);
cmd .Parameters.Add(new OracleParameter("SESSIONID", OracleType.VarChar,
100)).Direction = ParameterDirection.Input;
cmd .Parameters["SESSIONID"].Value = sessionid.ToUpper();
2) use of concatenated string:
OracleCommand cmd = new OracleCommand("SELECT PROJECT FROM USERS.LOGIN WHERE
UPPER(SESSIONID) = '" + sessionid.ToUpper() + "'", _con);
Will be the second command executed with less performance than the first
command? Or never mind?
Norbert
Is there an advantage of using parameter objects instead of using
concatenated command strings?
Example
1) use of parameter object:
OracleCommand cmd = new OracleCommand("SELECT PROJECT FROM USERS.LOGIN WHERE
UPPER(SESSIONID)=:SESSIONID", _con);
cmd .Parameters.Add(new OracleParameter("SESSIONID", OracleType.VarChar,
100)).Direction = ParameterDirection.Input;
cmd .Parameters["SESSIONID"].Value = sessionid.ToUpper();
2) use of concatenated string:
OracleCommand cmd = new OracleCommand("SELECT PROJECT FROM USERS.LOGIN WHERE
UPPER(SESSIONID) = '" + sessionid.ToUpper() + "'", _con);
Will be the second command executed with less performance than the first
command? Or never mind?
Norbert