public void ConvertRecposToNativeWithNegativeCentriesTotal() { var recpos = new JET_RECPOS(); recpos.centriesLT = 1; recpos.centriesTotal = Int64.MinValue; NATIVE_RECPOS native = recpos.GetNativeRecpos(); }
public void ConvertRecposToNativeWithNegativeCentriesLt() { var recpos = new JET_RECPOS(); recpos.centriesLT = -1; recpos.centriesTotal = 10; NATIVE_RECPOS native = recpos.GetNativeRecpos(); }
public void ConvertRecposToNative() { var recpos = new JET_RECPOS(); recpos.centriesLT = 5; recpos.centriesTotal = 10; NATIVE_RECPOS native = recpos.GetNativeRecpos(); Assert.AreEqual(5U, native.centriesLT); Assert.AreEqual(10U, native.centriesTotal); }
public void ConvertRecposFromNative() { var native = new NATIVE_RECPOS(); native.centriesLT = 1; native.centriesTotal = 2; var recpos = new JET_RECPOS(); recpos.SetFromNativeRecpos(native); Assert.AreEqual(1, recpos.centriesLT); Assert.AreEqual(2, recpos.centriesTotal); }
public void GotoLastPosition() { var recpos = new JET_RECPOS() { centriesLT = 4, centriesTotal = 4 }; Api.JetGotoPosition(this.sesid, this.tableid, recpos); int actual = this.GetLongColumn(); Assert.AreEqual(this.numRecords - 1, actual); }
public void GotoFirstPosition() { var recpos = new JET_RECPOS() { centriesLT = 0, centriesTotal = 10 }; Api.JetGotoPosition(this.sesid, this.tableid, recpos); int actual = this.GetLongColumn(); Assert.AreEqual(0, actual); }
/// <summary> /// Moves a cursor to a new location that is a fraction of the way through /// the current index. /// Also see <seealso cref="JetGetRecordPosition"/>. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The cursor to position.</param> /// <param name="recpos">The approximate position to move to.</param> public static void JetGotoPosition(JET_SESID sesid, JET_TABLEID tableid, JET_RECPOS recpos) { Api.Check(Impl.JetGotoPosition(sesid, tableid, recpos)); }
/// <summary> /// Returns the fractional position of the current record in the current index /// in the form of a <see cref="JET_RECPOS"/> structure. /// Also see <seealso cref="JetGotoPosition"/>. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The cursor positioned on the record.</param> /// <param name="recpos">Returns the approximate fractional position of the record.</param> public static void JetGetRecordPosition(JET_SESID sesid, JET_TABLEID tableid, out JET_RECPOS recpos) { Api.Check(Impl.JetGetRecordPosition(sesid, tableid, out recpos)); }
/// <summary> /// Goto the given fractional position on the current index /// </summary> /// <param name="position">The desired position on the current index of the cursor</param> /// <remarks> /// As a side effect, any restriction in effect will be cleared. /// </remarks> public void GotoPosition(Position position) { lock (this.isamSession) { this.CheckDisposed(); this.OnNavigation(); // clear our index range this.FindAllRecords(); // go to the given fractional position on the current index JET_RECPOS recpos = new JET_RECPOS(); recpos.centriesLT = position.Entry; recpos.centriesTotal = position.TotalEntries; Api.JetGotoPosition(this.isamSession.Sesid, this.tableid, recpos); // clear our field cache because the current record has changed this.fields = null; } }
public void JetRecposToString() { var recpos = new JET_RECPOS { centriesLT = 5, centriesTotal = 10 }; Assert.AreEqual("JET_RECPOS(5/10)", recpos.ToString()); }