Exemple #1
0
        /// <summary>
        /// Execute a V-SQL query that does not return a result set. These include INSERT, DELETE and UPDATE.
        /// </summary>
        public void ExecSQL()
        {
            //Execute SQL command
            //Set rowsAffected
            int rowsaffected = 0;

            if (queryID <= 0)
            {
                return;
            }

            if (opened)
            {
                throw new InvalidOperationException("Query opened");
            }

            lock (syncRoot)
            {
                VistaDBAPI.ivsql_SetSQL(queryID, commandText);
                sqlID        = VistaDBAPI.ivsql_ExecSQL(queryID, ref rowsaffected);
                rowsAffected = rowsaffected;
            }
        }
        /// <summary>
        /// Execute a V-SQL query that does not return a result set. These include INSERT, DELETE and UPDATE.
        /// </summary>
        public override void ExecSQL()
        {
            //Execute SQL command
            if (this.queryID == 0)
            {
                return;
            }

            if (this.opened)
            {
                throw new InvalidOperationException("Query already opened");
            }

            lock (syncRoot)
            {
                this.rowsAffected = 0;

                VistaDBAPI.ivsql_SetSQL(this.queryID, this.commandText);
                VistaDBAPI.ivsql_ExecSQL(this.queryID, ref this.rowsAffected);

                this.startTraversing = true;
            }
        }