Can i use @ symbol for bind variables instead of colon for O

Can i use @ symbol for bind variables instead of colon for O

Postby » Wed 15 Jul 2009 07:18

Dear helpers,

Previously we are using sql server 2005 database(and visual studio as client) so the code to
retrieve data as follows

StringBuilder selectQuery = new StringBuilder();
selectQuery.Append("FROM COR_DIV ");
selectQuery.Append("WHERE DIVISION_ID = @divisionId");

SqlConnection connection = null;
SqlCommand command = null;
SqlDataReader reader = null;
// get the connection and create the statement
connection = GetOpenConnection();
command = connection.CreateCommand();

command.CommandText = selectQuery.ToString();
DBUtil.SetIntParam(command, "@divisionId", divisionId);
interDivisionTrxOnShip = command.ExecuteScalar().ToString();
catch (Exception ex)


in DBUtil.SetIntParam method the code as follows
public static void SetIntParam(IDbCommand command, string paramName,
int paramValue)
IDbDataParameter param = command.CreateParameter();
param.ParameterName = paramName;
if (paramValue != int.MinValue)
param.Value = paramValue;
param.Value = DBNull.Value;


Now we migrate our database to oracle 11g,so we need to use ODP.Net data provider,
now my problem is i need to follow the same syntax as described above without changing
@ symbol for bind variables can you please help me to satisfy my needs.
Posts: 1
Joined: Wed 15 Jul 2009 07:14

Postby Shalex » Wed 15 Jul 2009 13:27

If you are using ODP.NET data provider, please visit ODP.NET forum. As for the dotConnect for Oracle syntax, parameters are declared using ':' prefix followed by the name of the parameter. For more information, please refer to ... Using.html , the Using Parameters section.
Devart Team
Posts: 7194
Joined: Thu 14 Aug 2008 12:44

Return to dotConnect for Oracle