public static extern int JetGetTableIndexInfo( IntPtr sesid, IntPtr tableid, string szIndexName, [Out] out JET_INDEXID result, uint cbResult, uint InfoLevel);
public void JetIndexIdToString() { var indexid = new JET_INDEXID { IndexId1 = (IntPtr)0x1, IndexId2 = 0x2, IndexId3 = 0x3 }; Assert.AreEqual("JET_INDEXID(0x1:0x2:0x3)", indexid.ToString()); }
public void VerifyJetIndexIdEquality() { var x = new JET_INDEXID { IndexId1 = (IntPtr)0x1, IndexId2 = 0x2, IndexId3 = 0x3 }; var y = new JET_INDEXID { IndexId1 = (IntPtr)0x1, IndexId2 = 0x2, IndexId3 = 0x3 }; TestEqualObjects(x, y); Assert.IsTrue(x == y); Assert.IsFalse(x != y); }
public static extern int JetSetCurrentIndex4(IntPtr sesid, IntPtr tableid, string szIndexName, [In] ref JET_INDEXID indexid, uint grbit, uint itagSequence);
/// <summary> /// Retrieves information about indexes on a table. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The table to retrieve index information about.</param> /// <param name="indexname">The name of the index.</param> /// <param name="result">Filled in with information about indexes on the table.</param> /// <param name="infoLevel">The type of information to retrieve.</param> /// <returns>true if there was no error, false if the index wasn't found. Throws for other Jet errors.</returns> public static bool TryJetGetTableIndexInfo( JET_SESID sesid, JET_TABLEID tableid, string indexname, out JET_INDEXID result, JET_IdxInfo infoLevel) { int err = Impl.JetGetTableIndexInfo(sesid, tableid, indexname, out result, infoLevel); if ((JET_err)err == JET_err.IndexNotFound) { return false; } Api.Check(err); return true; }
/// <summary> /// Set the current index of a cursor. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The cursor to set the index on.</param> /// <param name="index"> /// The name of the index to be selected. If this is null or empty the primary /// index will be selected. /// </param> /// <param name="indexid"> /// The id of the index to select. This id can be obtained using JetGetIndexInfo /// or JetGetTableIndexInfo with the <see cref="JET_IdxInfo.IndexId"/> option. /// </param> /// <param name="grbit"> /// Set index options. /// </param> /// <param name="itagSequence"> /// Sequence number of the multi-valued column value which will be used /// to position the cursor on the new index. This parameter is only used /// in conjunction with <see cref="SetCurrentIndexGrbit.NoMove"/>. When /// this parameter is not present or is set to zero, its value is presumed /// to be 1. /// </param> public static void JetSetCurrentIndex4( JET_SESID sesid, JET_TABLEID tableid, string index, JET_INDEXID indexid, SetCurrentIndexGrbit grbit, int itagSequence) { Api.Check(Impl.JetSetCurrentIndex4(sesid, tableid, index, indexid, grbit, itagSequence)); }
/// <summary> /// Retrieves information about indexes on a table. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The table to retrieve index information about.</param> /// <param name="indexname">The name of the index.</param> /// <param name="result">Filled in with information about indexes on the table.</param> /// <param name="infoLevel">The type of information to retrieve.</param> public static void JetGetTableIndexInfo( JET_SESID sesid, JET_TABLEID tableid, string indexname, out JET_INDEXID result, JET_IdxInfo infoLevel) { Api.Check(Impl.JetGetTableIndexInfo(sesid, tableid, indexname, out result, infoLevel)); }
/// <summary> /// Retrieves information about indexes on a table. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="dbid">The database to use.</param> /// <param name="tablename">The name of the table to retrieve index information about.</param> /// <param name="indexname">The name of the index to retrieve information about.</param> /// <param name="result">Filled in with information about indexes on the table.</param> /// <param name="infoLevel">The type of information to retrieve.</param> public static void JetGetIndexInfo( JET_SESID sesid, JET_DBID dbid, string tablename, string indexname, out JET_INDEXID result, JET_IdxInfo infoLevel) { Api.Check(Impl.JetGetIndexInfo(sesid, dbid, tablename, indexname, out result, infoLevel)); }