S
Sven Jacobs
Dear newsgroup,
while developing an ASP.NET application I came across a problem. I am
collecting data from an Oracle 8i database using parameters. Unfortunately
I get an empty result set if the parameter is a string. It works with
integer!
Assuming conn is an OracleConnection object:
--snip--
OracleCommand cmd = new OracleCommand( "SELECT * FROM TEST " +
"WHERE ID = :name",
conn );
cmd.Parameters.Add( "name", "XY" );
OracleDataReader reader = cmd.ExecuteReader();
--snip--
I've tried to explicitly convert the parameter to OracleString:
cmd.Parameters.Add( "name", new OracleString( "XY" ) );
The affected column is of type CHAR(2). The .NET framework is version
1.1.4322 SP1.
while developing an ASP.NET application I came across a problem. I am
collecting data from an Oracle 8i database using parameters. Unfortunately
I get an empty result set if the parameter is a string. It works with
integer!
Assuming conn is an OracleConnection object:
--snip--
OracleCommand cmd = new OracleCommand( "SELECT * FROM TEST " +
"WHERE ID = :name",
conn );
cmd.Parameters.Add( "name", "XY" );
OracleDataReader reader = cmd.ExecuteReader();
--snip--
I've tried to explicitly convert the parameter to OracleString:
cmd.Parameters.Add( "name", new OracleString( "XY" ) );
The affected column is of type CHAR(2). The .NET framework is version
1.1.4322 SP1.