/// <summary> /// Try to navigate through an index. If the navigation succeeds this /// method returns true. If there is no record to navigate to this /// method returns false; an exception will be thrown for other errors. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The cursor to position.</param> /// <param name="move">The direction to move in.</param> /// <param name="grbit">Move options.</param> /// <returns>True if the move was successful.</returns> public static bool TryMove(JET_SESID sesid, JET_TABLEID tableid, JET_Move move, MoveGrbit grbit) { var err = (JET_err)Impl.JetMove(sesid, tableid, (int)move, grbit); if (JET_err.NoCurrentRecord == err) { return false; } Api.Check((int)err); Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error"); return true; }
/// <summary> /// Try to navigate through an index. If the navigation succeeds this /// method returns true. If there is no record to navigate to this /// method returns false; an exception will be thrown for other errors. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The cursor to position.</param> /// <param name="move">The direction to move in.</param> /// <param name="grbit">Move options.</param> /// <returns>True if the move was successful.</returns> public static bool TryMove(JET_SESID sesid, JET_TABLEID tableid, JET_Move move, MoveGrbit grbit) { var err = (JET_err)Impl.JetMove(sesid, tableid, (int)move, grbit); if (JET_err.NoCurrentRecord == err) { return(false); } Api.Check((int)err); Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error"); return(true); }
/// <summary> /// Navigate through an index. The cursor can be positioned at the start or /// end of the index and moved backwards and forwards by a specified number /// of index entries. Also see /// <seealso cref="TryMoveFirst"/>, <seealso cref="TryMoveLast"/>, /// <seealso cref="TryMoveNext"/>, <seealso cref="TryMovePrevious"/>. /// </summary> /// <param name="sesid">The session to use for the call.</param> /// <param name="tableid">The cursor to position.</param> /// <param name="numRows">An offset which indicates how far to move the cursor.</param> /// <param name="grbit">Move options.</param> public static void JetMove(JET_SESID sesid, JET_TABLEID tableid, JET_Move numRows, MoveGrbit grbit) { Api.Check(Impl.JetMove(sesid, tableid, (int)numRows, grbit)); }