Ejemplo n.º 1
0
 /// <summary>
 /// Sets the fields of the object from a native JET_COLUMNDEF struct.
 /// </summary>
 /// <param name="value">
 /// The native columndef to set the values from.
 /// </param>
 internal void SetFromNativeColumndef(NATIVE_COLUMNDEF value)
 {
     this.coltyp   = (JET_coltyp)value.coltyp;
     this.cp       = (JET_CP)value.cp;
     this.cbMax    = checked ((int)value.cbMax);
     this.grbit    = (ColumndefGrbit)value.grbit;
     this.columnid = new JET_COLUMNID {
         Value = value.columnid
     };
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the unmanaged columndef that represents this managed class.
        /// </summary>
        /// <returns>A native (interop) version of the JET_COLUMNDEF.</returns>
        internal NATIVE_COLUMNDEF GetNativeColumndef()
        {
            var columndef = new NATIVE_COLUMNDEF();

            columndef.cbStruct = checked ((uint)Marshal.SizeOf(columndef));
            columndef.cp       = (ushort)this.cp;
            columndef.cbMax    = checked ((uint)this.cbMax);
            columndef.grbit    = (uint)this.grbit;
            columndef.coltyp   = checked ((uint)this.coltyp);
            return(columndef);
        }
Ejemplo n.º 3
0
        public void ConvertColumndefFromNative()
        {
            var native = new NATIVE_COLUMNDEF()
            {
                cbMax = 1,
                coltyp = (uint)JET_coltyp.LongText,
                columnid = 0x100,
                cp = 1200,
                grbit = (uint)ColumndefGrbit.ColumnMultiValued,
            };

            var columndef = new JET_COLUMNDEF();
            columndef.SetFromNativeColumndef(native);
            Assert.AreEqual(1, columndef.cbMax);
            Assert.AreEqual(JET_coltyp.LongText, columndef.coltyp);
            Assert.AreEqual<uint>(0x100, columndef.columnid.Value);
            Assert.AreEqual(JET_CP.Unicode, columndef.cp);
            Assert.AreEqual(ColumndefGrbit.ColumnMultiValued, columndef.grbit);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns the unmanaged columndef that represents this managed class.
 /// </summary>
 /// <returns>A native (interop) version of the JET_COLUMNDEF.</returns>
 internal NATIVE_COLUMNDEF GetNativeColumndef()
 {
     var columndef       = new NATIVE_COLUMNDEF();
     columndef.cbStruct  = checked((uint) Marshal.SizeOf(columndef));
     columndef.cp        = (ushort)this.cp;
     columndef.cbMax     = checked((uint) this.cbMax);
     columndef.grbit     = (uint)this.grbit;
     columndef.coltyp    = checked((uint) this.coltyp);
     return columndef;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Sets the fields of the object from a native JET_COLUMNDEF struct.
 /// </summary>
 /// <param name="value">
 /// The native columndef to set the values from.
 /// </param>
 internal void SetFromNativeColumndef(NATIVE_COLUMNDEF value)
 {
     this.coltyp = (JET_coltyp)value.coltyp;
     this.cp = (JET_CP)value.cp;
     this.cbMax = checked((int) value.cbMax);
     this.grbit = (ColumndefGrbit)value.grbit;
     this.columnid = new JET_COLUMNID { Value = value.columnid };
 }
Ejemplo n.º 6
0
 public static extern int JetGetTableColumnInfo(IntPtr sesid, IntPtr tableid, ref uint pcolumnid, ref NATIVE_COLUMNDEF columndef, uint cbMax, uint InfoLevel);
Ejemplo n.º 7
0
 public static extern int JetGetColumnInfo(IntPtr sesid, uint dbid, string szTableName, string szColumnName, ref NATIVE_COLUMNDEF columndef, uint cbMax, uint InfoLevel);