ParameterCheck
Posted: Fri 22 Apr 2011 07:48
Hi
with the following piece of code
UniConnection conn = new UniConnection(cs.ConnectionString);
UniCommand cmd = new UniCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
//cmd.ParameterCheck = true;
cmd.CommandText = "MyStoredProcedure";
....some parameter defs
UniParameter par4 = new UniParameter("v_Activated", UniDbType.Int);
par4.Direction = ParameterDirection.Output;
cmd.Parameters.Add(par4);
conn.Open();
cmd.ExecuteNonQuery();
Activated = (int)cmd.Parameters["v_Activated"].Value;
all runs fine; if I decomment cmd.ParameterCheck = true, I've a cast exception in the last line (the connection is to Oracle and the stored procedure parameter v_Activated is defined as number). I've seen that the c# type of Value is UniDecimal type.
Best Regard
Marco
with the following piece of code
UniConnection conn = new UniConnection(cs.ConnectionString);
UniCommand cmd = new UniCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
//cmd.ParameterCheck = true;
cmd.CommandText = "MyStoredProcedure";
....some parameter defs
UniParameter par4 = new UniParameter("v_Activated", UniDbType.Int);
par4.Direction = ParameterDirection.Output;
cmd.Parameters.Add(par4);
conn.Open();
cmd.ExecuteNonQuery();
Activated = (int)cmd.Parameters["v_Activated"].Value;
all runs fine; if I decomment cmd.ParameterCheck = true, I've a cast exception in the last line (the connection is to Oracle and the stored procedure parameter v_Activated is defined as number). I've seen that the c# type of Value is UniDecimal type.
Best Regard
Marco