CursorGetDuplicateCount() private method

private CursorGetDuplicateCount ( IntPtr handle, int &count, int flags ) : int
handle System.IntPtr
count int
flags int
return int
Ejemplo n.º 1
0
        /// <summary>
        /// Returns the number of duplicate keys
        /// </summary>
        /// <remarks>
        /// This method wraps the native ups_cursor_get_duplicate_count function.
        /// <br />
        /// Returns the number of duplicate keys of the item to which the
        /// Cursor currently refers.
        /// <br />
        /// Returns 1 if the key has no duplicates.
        /// </remarks>
        /// <returns>The number of duplicate keys of the current item</returns>
        /// <exception cref="DatabaseException">
        ///   <list type="bullet">
        ///   <item><see cref="UpsConst.UPS_CURSOR_IS_NIL"/>
        ///     if the Cursor does not point to any item</item>
        ///   </list>
        /// </exception>
        public int GetDuplicateCount()
        {
            int count, st;

            lock (db) {
                st = NativeMethods.CursorGetDuplicateCount(handle, out count, 0);
            }
            if (st != 0)
            {
                throw new DatabaseException(st);
            }
            return(count);
        }