Hello,
I have this parameter
OracleParameter p1 = new OracleParameter("p1", OracleType.VarChar, 8);
p1.Direction = ParameterDirection.InputOutput;
and I have a
I use the line :
p1.Value = val;
and in the debugger I see that val has the "ABCD" value but p1 has only "AB"
I tried with
any ideas what is wrong and how to fix it? I use this line in other code too, and it makes no problems.
Thanks,
Probi
Loading
Guest UserPosted Jul 9, 2008, 7:45 PM
ExecuteReader() is for SELECT statements.
ExecuteNonQuery() is for UPDATEs, DELETEs and INSERTs.
When you call both, you are executing the same SQL code twice for no reason. This is very inefficient and will make your code run slower than it needs to.
Remove the ExecuteNonQuery() call and see what happens.
Probi ForumiPosted Jul 8, 2008, 5:29 AM
the command is
string
cmd2 = "Select Iteration_Name from Iterations where Project =:p2"; OracleCommand command2 = new OracleCommand(cmd2, connection); OracleParameter p2 = new OracleParameter("p2", OracleType.VarChar , 8);in other code I have used ExecuteNonQuery() and ExecuteReader() in that order and it showed no problem... I can not figure out why here it cuts the string
thanks
Probi
Guest UserPosted Jul 7, 2008, 11:01 PM
Can you post the source code for the SQL code being called?
Probi ForumiPosted Jul 7, 2008, 9:44 AM
This is what I see when I put the breakpoints
p1.Value = val ( p1 = ABCD)
command1.ExecuteNonQuery(); (p1 = AB)
rdr1 = command1.ExecuteReader(); (p1 = A)
while (rdr1.Read())
{
do something
} (p1="")
why is this happening?
thanks
Probi
Guest UserPosted Jul 1, 2008, 2:31 PM