public static void DeriveParameters(OracleCommand command)
        {
            OracleConnection.ExecutePermission.Demand();
            if (command == null)
            {
                throw System.Data.Common.ADP.ArgumentNull("command");
            }
            CommandType commandType = command.CommandType;

            if (commandType != CommandType.Text)
            {
                if (commandType == CommandType.StoredProcedure)
                {
                    if (System.Data.Common.ADP.IsEmpty(command.CommandText))
                    {
                        throw System.Data.Common.ADP.CommandTextRequired("DeriveParameters");
                    }
                    OracleConnection connection = command.Connection;
                    if (connection == null)
                    {
                        throw System.Data.Common.ADP.ConnectionRequired("DeriveParameters");
                    }
                    ConnectionState state = connection.State;
                    if (ConnectionState.Open != state)
                    {
                        throw System.Data.Common.ADP.OpenConnectionRequired("DeriveParameters", state);
                    }
                    ArrayList list = DeriveParametersFromStoredProcedure(connection, command);
                    OracleParameterCollection parameters = command.Parameters;
                    parameters.Clear();
                    int count = list.Count;
                    for (int i = 0; i < count; i++)
                    {
                        parameters.Add((OracleParameter)list[i]);
                    }
                    return;
                }
                if (commandType != CommandType.TableDirect)
                {
                    throw System.Data.Common.ADP.InvalidCommandType(command.CommandType);
                }
            }
            throw System.Data.Common.ADP.DeriveParametersNotSupported(command);
        }
示例#2
0
 public override void Clear()
 {
     parcol.Clear();
 }