示例#1
0
        protected virtual CommandBehavior SQLCommandBehaviorToCommandBehavior(SQLCommandBehavior commandBehavior)
        {
            System.Data.CommandBehavior behavior = System.Data.CommandBehavior.Default | System.Data.CommandBehavior.SingleResult;

            if ((commandBehavior & SQLCommandBehavior.KeyInfo) != 0)
            {
                behavior |= System.Data.CommandBehavior.KeyInfo;
            }

            if ((commandBehavior & SQLCommandBehavior.SchemaOnly) != 0)
            {
                behavior |= System.Data.CommandBehavior.SchemaOnly;
            }

            return(behavior);
        }
示例#2
0
        public SQLCursor Open(string AStatement, SQLParameters AParameters, SQLCursorType ACursorType, SQLIsolationLevel ACursorIsolationLevel, SQLCommandBehavior ABehavior)
        {
            CheckConnectionValid();
            SQLCommand LCommand = CreateCommand();

            try
            {
                LCommand.Statement = AStatement;
                LCommand.Parameters.AddRange(AParameters);
                LCommand.CommandBehavior = ABehavior;
                return(LCommand.Open(ACursorType, ACursorIsolationLevel));
            }
            catch
            {
                LCommand.Dispose();
                throw;
            }
        }
示例#3
0
        public SQLCursor Open(string statement, SQLParameters parameters, SQLCursorType cursorType, SQLIsolationLevel cursorIsolationLevel, SQLCommandBehavior behavior)
        {
            CheckConnectionValid();
            SQLCommand command = CreateCommand(true);

            try
            {
                command.Statement = statement;
                command.Parameters.AddRange(parameters);
                command.CommandBehavior = behavior;
                return(command.Open(cursorType, cursorIsolationLevel));
            }
            catch
            {
                command.Dispose();
                throw;
            }
        }