JetPrepareUpdate() public static méthode

Prepare a cursor for update.
public static JetPrepareUpdate ( JET_SESID sesid, JET_TABLEID tableid, JET_prep prep ) : void
sesid JET_SESID The session which is starting the update.
tableid JET_TABLEID The cursor to start the update for.
prep JET_prep The type of update to prepare.
Résultat void
Exemple #1
0
        /// <summary>
        /// Cancel the update.
        /// </summary>
        public void Cancel()
        {
            this.CheckObjectIsNotDisposed();
            if (!this.HasResource)
            {
                throw new InvalidOperationException("Not in an update");
            }

            Api.JetPrepareUpdate(this.sesid, this.tableid, JET_prep.Cancel);
            this.ResourceWasReleased();
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the Update class. This automatically
        /// begins an update. The update will be cancelled if
        /// not explicitly saved.
        /// </summary>
        /// <param name="sesid">The session to start the transaction for.</param>
        /// <param name="tableid">The tableid to prepare the update for.</param>
        /// <param name="prep">The type of update.</param>
        public Update(JET_SESID sesid, JET_TABLEID tableid, JET_prep prep)
        {
            if (JET_prep.Cancel == prep)
            {
                throw new ArgumentException("Cannot create an Update for JET_prep.Cancel", "prep");
            }

            this.sesid   = sesid;
            this.tableid = tableid;
            Api.JetPrepareUpdate(this.sesid, this.tableid, prep);
            this.ResourceWasAllocated();
        }