static public void DeriveParameters(OdbcCommand command)
        {
            // MDAC 65927
            OdbcConnection.ExecutePermission.Demand();

            if (null == command)
            {
                throw ADP.ArgumentNull("command");
            }
            switch (command.CommandType)
            {
            case System.Data.CommandType.Text:
                throw ADP.DeriveParametersNotSupported(command);

            case System.Data.CommandType.StoredProcedure:
                break;

            case System.Data.CommandType.TableDirect:
                // CommandType.TableDirect - do nothing, parameters are not supported
                throw ADP.DeriveParametersNotSupported(command);

            default:
                throw ADP.InvalidCommandType(command.CommandType);
            }
            if (ADP.IsEmpty(command.CommandText))
            {
                throw ADP.CommandTextRequired(ADP.DeriveParameters);
            }

            OdbcConnection connection = command.Connection;

            if (null == connection)
            {
                throw ADP.ConnectionRequired(ADP.DeriveParameters);
            }

            ConnectionState state = connection.State;

            if (ConnectionState.Open != state)
            {
                throw ADP.OpenConnectionRequired(ADP.DeriveParameters, state);
            }

            OdbcParameter[] list = DeriveParametersFromStoredProcedure(connection, command);

            OdbcParameterCollection parameters = command.Parameters;

            parameters.Clear();

            int count = list.Length;

            if (0 < count)
            {
                for (int i = 0; i < list.Length; ++i)
                {
                    parameters.Add(list[i]);
                }
            }
        }
        public static void DeriveParameters(OdbcCommand command)
        {
            OdbcConnection.ExecutePermission.Demand();
            if (command == null)
            {
                throw ADP.ArgumentNull("command");
            }
            CommandType commandType = command.CommandType;

            if (commandType == CommandType.Text)
            {
                throw ADP.DeriveParametersNotSupported(command);
            }
            if (commandType != CommandType.StoredProcedure)
            {
                if (commandType == CommandType.TableDirect)
                {
                    throw ADP.DeriveParametersNotSupported(command);
                }
                throw ADP.InvalidCommandType(command.CommandType);
            }
            if (ADP.IsEmpty(command.CommandText))
            {
                throw ADP.CommandTextRequired("DeriveParameters");
            }
            OdbcConnection connection = command.Connection;

            if (connection == null)
            {
                throw ADP.ConnectionRequired("DeriveParameters");
            }
            ConnectionState state = connection.State;

            if (ConnectionState.Open != state)
            {
                throw ADP.OpenConnectionRequired("DeriveParameters", state);
            }
            OdbcParameter[]         parameterArray = DeriveParametersFromStoredProcedure(connection, command);
            OdbcParameterCollection parameters     = command.Parameters;

            parameters.Clear();
            int length = parameterArray.Length;

            if (0 < length)
            {
                for (int i = 0; i < parameterArray.Length; i++)
                {
                    parameters.Add(parameterArray[i]);
                }
            }
        }