当前位置: 首页>>代码示例>>C#>>正文


C# JET_COLUMNID类代码示例

本文整理汇总了C#中JET_COLUMNID的典型用法代码示例。如果您正苦于以下问题:C# JET_COLUMNID类的具体用法?C# JET_COLUMNID怎么用?C# JET_COLUMNID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JET_COLUMNID类属于命名空间,在下文中一共展示了JET_COLUMNID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConvertObjectlistFromNative

        public void ConvertObjectlistFromNative()
        {
            var tableid = new JET_TABLEID { Value = (IntPtr)0x1000 };
            var col1 = new JET_COLUMNID { Value = 1 };
            var col2 = new JET_COLUMNID { Value = 2 };
            var col3 = new JET_COLUMNID { Value = 3 };
            var col4 = new JET_COLUMNID { Value = 4 };
            var col5 = new JET_COLUMNID { Value = 5 };
            var col6 = new JET_COLUMNID { Value = 6 };

            var native = new NATIVE_OBJECTLIST()
            {
                tableid = tableid.Value,
                cRecord = 100,
                columnidobjectname = col1.Value,
                columnidobjtyp = col2.Value,
                columnidgrbit = col3.Value,
                columnidflags = col4.Value,
                columnidcRecord = col5.Value,
                columnidcPage = col6.Value,
            };

            var objectlist = new JET_OBJECTLIST();
            objectlist.SetFromNativeObjectlist(native);

            Assert.AreEqual(tableid, objectlist.tableid);
            Assert.AreEqual(100, objectlist.cRecord);
            Assert.AreEqual(col1, objectlist.columnidobjectname);
            Assert.AreEqual(col2, objectlist.columnidobjtyp);
            Assert.AreEqual(col3, objectlist.columnidgrbit);
            Assert.AreEqual(col4, objectlist.columnidflags);
            Assert.AreEqual(col5, objectlist.columnidcRecord);
            Assert.AreEqual(col6, objectlist.columnidcPage);
        }
开发者ID:ayende,项目名称:managed-esent,代码行数:34,代码来源:ObjectlistTests.cs

示例2: StringNameTableAccessor

 public StringNameTableAccessor(
     OpenSession session, string tableName, string indexName, JET_COLUMNID idColumnId, JET_COLUMNID nameColumnId) : base(session, tableName)
 {
     _indexName = indexName;
     _idColumnId = idColumnId;
     _nameColumnId = nameColumnId;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:7,代码来源:EsentStorage.StringNameTableAccessor.cs

示例3: SortDataWithJetOpenTempTable

        public void SortDataWithJetOpenTempTable()
        {
            JET_TABLEID tableid;
            var columns = new[]
            {
                new JET_COLUMNDEF { coltyp = JET_coltyp.Long, grbit = ColumndefGrbit.TTKey },
                new JET_COLUMNDEF { coltyp = JET_coltyp.Text, cp = JET_CP.Unicode },
            };
            var columnids = new JET_COLUMNID[columns.Length];

            Api.JetOpenTempTable(this.session, columns, columns.Length, TempTableGrbit.Scrollable, out tableid, columnids);

            for (int i = 5; i >= 0; --i)
            {
                using (var update = new Update(this.session, tableid, JET_prep.Insert))
                {
                    Api.SetColumn(this.session, tableid, columnids[0], i);
                    Api.SetColumn(this.session, tableid, columnids[1], i.ToString(), Encoding.Unicode);
                    update.Save();
                }
            }

            var expected = new[] { "0", "1", "2", "3", "4", "5" };
            CollectionAssert.AreEqual(expected, this.RetrieveAllRecordsAsString(tableid, columnids[1]).ToArray());
            Api.JetCloseTable(this.session, tableid);
        }
开发者ID:jtmueller,项目名称:ravendb,代码行数:26,代码来源:TemporaryTableTests.cs

示例4: JetRetrieveColumn

        /// <summary>
        /// Retrieves a single column value from the current record. The record is that
        /// record associated with the index entry at the current position of the cursor.
        /// Alternatively, this function can retrieve a column from a record being created
        /// in the cursor copy buffer. This function can also retrieve column data from an
        /// index entry that references the current record. In addition to retrieving the
        /// actual column value, JetRetrieveColumn can also be used to retrieve the size
        /// of a column, before retrieving the column data itself so that application
        /// buffers can be sized appropriately.  
        /// </summary>
        /// <remarks>
        /// This is an internal method that takes a buffer offset as well as size.
        /// </remarks>
        /// <param name="sesid">The session to use.</param>
        /// <param name="tableid">The cursor to retrieve the column from.</param>
        /// <param name="columnid">The columnid to retrieve.</param>
        /// <param name="data">The data buffer to be retrieved into.</param>
        /// <param name="dataSize">The size of the data buffer.</param>
        /// <param name="dataOffset">Offset into the data buffer to read data into.</param>
        /// <param name="actualDataSize">Returns the actual size of the data buffer.</param>
        /// <param name="grbit">Retrieve column options.</param>
        /// <param name="retinfo">
        /// If pretinfo is give as NULL then the function behaves as though an itagSequence
        /// of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to
        /// retrieve the first value of a multi-valued column, and to retrieve long data at
        /// offset 0 (zero).
        /// </param>
        /// <returns>An ESENT warning code.</returns>
        public static JET_wrn JetRetrieveColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data, int dataSize, int dataOffset, out int actualDataSize, RetrieveColumnGrbit grbit, JET_RETINFO retinfo)
        {
            if (dataOffset < 0
                || (null != data && 0 != dataSize && dataOffset >= data.Length)
                || (null == data && dataOffset != 0))
            {
                throw new ArgumentOutOfRangeException(
                    "dataOffset",
                    dataOffset,
                    "must be inside the data buffer");
            }

            if ((null == data && dataSize > 0) || (null != data && dataSize > data.Length))
            {
                throw new ArgumentOutOfRangeException(
                    "dataSize",
                    dataSize,
                    "cannot be greater than the length of the data");
            }

            unsafe
            {
                fixed (byte* pointer = data)
                {
                    return Api.JetRetrieveColumn(
                        sesid, tableid, columnid, new IntPtr(pointer + dataOffset), dataSize, out actualDataSize, grbit, retinfo);
                }
            }
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:57,代码来源:InternalApi.cs

示例5: GetColumnIds

 protected void GetColumnIds(
     JET_COLUMNCREATE[] columns, out JET_COLUMNID projectColumnId, out JET_COLUMNID projectNameColumnId, out JET_COLUMNID documentColumnId)
 {
     projectColumnId = columns[0].columnid;
     projectNameColumnId = columns[1].columnid;
     documentColumnId = columns[2].columnid;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:EsentStorage.ProjectDocumentTable.cs

示例6: Setup

        public void Setup()
        {
            this.directory = SetupHelper.CreateRandomDirectory();
            this.instance = SetupHelper.CreateNewInstance(this.directory);

            // turn off logging so initialization is faster
            Api.JetSetSystemParameter(this.instance, JET_SESID.Nil, JET_param.Recovery, 0, "off");
            Api.JetInit(ref this.instance);
            Api.JetBeginSession(this.instance, out this.sesid, String.Empty, String.Empty);

            var columns = new[] { new JET_COLUMNDEF { coltyp = JET_coltyp.Long, grbit = ColumndefGrbit.TTKey } };
            var columnids = new JET_COLUMNID[columns.Length];

            // BUG: use TempTableGrbit.Indexed once in-memory TT bugs are fixed
            Api.JetOpenTempTable(this.sesid, columns, columns.Length, TempTableGrbit.ForceMaterialization, out this.tableid, columnids);
            this.columnid = columnids[0];

            for (int i = 10; i <= 30; i += 10)
            {
                Api.JetPrepareUpdate(this.sesid, this.tableid, JET_prep.Insert);
                Api.JetSetColumn(this.sesid, this.tableid, this.columnid, BitConverter.GetBytes(i), 4, SetColumnGrbit.None, null);
                int ignored;
                Api.JetUpdate(this.sesid, this.tableid, null, 0, out ignored);
            }
        }
开发者ID:Rationalle,项目名称:ravendb,代码行数:25,代码来源:SeekTests.cs

示例7: JetSetColumn

        /// <summary>
        /// The JetSetColumn function modifies a single column value in a modified record to be inserted or to
        /// update the current record. It can overwrite an existing value, add a new value to a sequence of
        /// values in a multi-valued column, remove a value from a sequence of values in a multi-valued column,
        /// or update all or part of a long value (a column of type <see cref="JET_coltyp.LongText"/>
        /// or <see cref="JET_coltyp.LongBinary"/>). 
        /// </summary>
        /// <remarks>
        /// This is an internal-only version of the API that takes a data buffer and an offset into the buffer.
        /// </remarks>
        /// <param name="sesid">The session which is performing the update.</param>
        /// <param name="tableid">The cursor to update. An update should be prepared.</param>
        /// <param name="columnid">The columnid to set.</param>
        /// <param name="data">The data to set.</param>
        /// <param name="dataSize">The size of data to set.</param>
        /// <param name="dataOffset">The offset in the data buffer to set data from.</param>
        /// <param name="grbit">SetColumn options.</param>
        /// <param name="setinfo">Used to specify itag or long-value offset.</param>
        /// <returns>A warning value.</returns>
        public static JET_wrn JetSetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data, int dataSize, int dataOffset, SetColumnGrbit grbit, JET_SETINFO setinfo)
        {
            if (dataOffset < 0
                || (null != data && 0 != dataSize && dataOffset >= data.Length)
                || (null == data && dataOffset != 0))
            {
                throw new ArgumentOutOfRangeException(
                    "dataOffset",
                    dataOffset,
                    "must be inside the data buffer");                    
            }

            if (null != data && dataSize > checked(data.Length - dataOffset) && (SetColumnGrbit.SizeLV != (grbit & SetColumnGrbit.SizeLV)))
            {
                throw new ArgumentOutOfRangeException(
                    "dataSize",
                    dataSize,
                    "cannot be greater than the length of the data (unless the SizeLV option is used)");
            }

            unsafe
            {
                fixed (byte* pointer = data)
                {
                    return Api.JetSetColumn(sesid, tableid, columnid, new IntPtr(pointer + dataOffset), dataSize, grbit, setinfo);
                }
            }
        }
开发者ID:925coder,项目名称:ravendb,代码行数:47,代码来源:InternalApi.cs

示例8: JetGetTableColumnInfo

 /// <summary>
 /// Retrieves information about a table column.
 /// </summary>
 /// <param name="sesid">The session to use.</param>
 /// <param name="tableid">The table containing the column.</param>
 /// <param name="columnid">The columnid of the column.</param>
 /// <param name="columnbase">Filled in with information about the column.</param>
 public static void JetGetTableColumnInfo(
     JET_SESID sesid,
     JET_TABLEID tableid,
     JET_COLUMNID columnid,
     out JET_COLUMNBASE columnbase)
 {
     Api.Check(Api.Impl.JetGetTableColumnInfo(sesid, tableid, columnid, out columnbase));
 }
开发者ID:nick121212,项目名称:xima_desktop3,代码行数:15,代码来源:VistaApi.cs

示例9: SetFromNativeRetinfo

        /// <summary>
        /// Sets the fields of the object from a NATIVE_RETINFO structure.
        /// </summary>
        /// <param name="value">The NATIVE_RETINFO which will be used to set the fields.</param>
        internal void SetFromNativeRetinfo(NATIVE_RETINFO value)
        {
            this.ibLongValue = checked((int)value.ibLongValue);
            this.itagSequence = checked((int)value.itagSequence);

            var columnid = new JET_COLUMNID { Value = value.columnidNextTagged };
            this.columnidNextTagged = columnid;
        }
开发者ID:Rationalle,项目名称:ravendb,代码行数:12,代码来源:jet_retinfo.cs

示例10: ProjectTableAccessor

 public ProjectTableAccessor(
     OpenSession session, string tableName, string indexName,
     JET_COLUMNID projectColumnId, JET_COLUMNID projectNameColumnId, JET_COLUMNID nameColumnId, JET_COLUMNID valueColumnId) :
     base(session, tableName, indexName, projectColumnId, projectNameColumnId, default(JET_COLUMNID))
 {
     _nameColumnId = nameColumnId;
     _valueColumnId = valueColumnId;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:EsentStorage.ProjectTableAccessor.cs

示例11: SolutionTableAccessor

            public SolutionTableAccessor(
                OpenSession session, string tableName, string indexName, JET_COLUMNID nameColumnId, JET_COLUMNID valueColumnId) : base(session, tableName)
            {
                _indexName = indexName;

                _nameColumnId = nameColumnId;
                _valueColumnId = valueColumnId;
            }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:EsentStorage.SolutionTableAccessor.cs

示例12: Setup

 public void Setup()
 {
     this.converter = Dependencies.Container.Resolve<InteropConversion>();
     this.columnid = new JET_COLUMNID
         {
             Value = Any.UInt16
         };
 }
开发者ID:j2jensen,项目名称:ravendb,代码行数:8,代码来源:InteropConversionTests.cs

示例13: ColumnStream

 /// <summary>
 /// Initializes a new instance of the ColumnStream class.
 /// </summary>
 /// <param name="sesid">The session to use.</param>
 /// <param name="tableid">The cursor to use.</param>
 /// <param name="columnid">The columnid of the column to set/retrieve data from.</param>
 public ColumnStream(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid)
 {
     this.sesid = sesid;
     this.tableid = tableid;
     this.columnid = columnid;
     this.ibLongValue = 0;
     this.Itag = 1;
 }
开发者ID:madmonkey,项目名称:managed-esent,代码行数:14,代码来源:ColumnStream.cs

示例14: GetInt32Column

            public static Int32ColumnValue GetInt32Column(JET_COLUMNID columnId, int value)
            {
                var column = SharedPools.Default<Int32ColumnValue>().Allocate();
                column.Columnid = columnId;
                column.Value = value;

                return column;
            }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:EsentStorage.Pool.cs

示例15: IdentifierLocationTableAccessor

 public IdentifierLocationTableAccessor(
     OpenSession session, string tableName, string primaryIndexName,
     JET_COLUMNID projectColumnId, JET_COLUMNID projectNameColumnId, JET_COLUMNID documentColumnId,
     JET_COLUMNID identifierColumnId, JET_COLUMNID valueColumnId) :
     base(session, tableName, primaryIndexName, projectColumnId, projectNameColumnId, documentColumnId)
 {
     _identifierColumnId = identifierColumnId;
     _valueColumnId = valueColumnId;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:9,代码来源:EsentStorage.IdentifierLocationTableAccessor.cs


注:本文中的JET_COLUMNID类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。