public void VerifyRecposCanBeSerialized() { var expected = new JET_RECPOS { centriesLT = 10, centriesTotal = 11 }; SerializeAndCompareContent(expected); }
public void JetRecposToString() { var recpos = new JET_RECPOS { centriesLT = 5, centriesTotal = 10 }; Assert.AreEqual("JET_RECPOS(5/10)", recpos.ToString()); }
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 VerifyJetRecposEquality() { var x = new JET_RECPOS { centriesLT = 1, centriesTotal = 2 }; var y = new JET_RECPOS { centriesLT = 1, centriesTotal = 2 }; TestContentEquals(x, y); }
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); }
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); }
// http://blogs.msdn.com/laurionb/archive/2009/02/10/cheaply-estimating-the-number-of-records-in-a-table.aspx // http://webcache.googleusercontent.com/search?q=cache:budnenpY5RUJ:blogs.msdn.com/b/laurionb/archive/2009/02/10/cheaply-estimating-the-number-of-records-in-a-table.aspx+http://blogs.msdn.com/laurionb/archive/2009/02/10/cheaply-estimating-the-number-of-records-in-a-table.aspx&hl=en&strip=1 int iRecordsetFilter.EstimateRecordsCount() { Api.JetSetCurrentIndex(cur.idSession, cur.idTable, indName); Api.ResetIndexRange(cur.idSession, cur.idTable); const int cSamples = 16; long cRecordsTotal = 0; JET_RECPOS recpos = new JET_RECPOS(); for (int i = 0; i < cSamples; i++) { recpos.centriesTotal = cSamples + 1; recpos.centriesLT = i + 1; Api.JetGotoPosition(cur.idSession, cur.idTable, recpos); Api.JetGetRecordPosition(cur.idSession, cur.idTable, out recpos); cRecordsTotal += recpos.centriesTotal; } return((int)(cRecordsTotal / cSamples)); }