Upscaledb.Database.Insert C# (CSharp) 메소드

Insert() 공개 메소드

Inserts a Database item
This is an overloaded function for Database.Insert(txn, key, record, 0).
public Insert ( Transaction txn, byte key, byte record ) : void
txn Transaction
key byte
record byte
리턴 void
        public void Insert(Transaction txn, byte[] key, byte[] record)
        {
            Insert(txn, key, record, 0);
        }

Same methods

Database::Insert ( Transaction txn, byte key, byte record, int flags ) : void
Database::Insert ( byte key, byte record ) : void
Database::Insert ( byte key, byte record, int flags ) : void

Usage Example

예제 #1
0
        private void SetComparator()
        {
            Upscaledb.Environment env = new Upscaledb.Environment();
            Database db = new Database();
            byte[] k = new byte[5];
            byte[] r = new byte[5];
            Parameter[] param = new Parameter[1];
            param[0] = new Parameter();
            param[0].name = UpsConst.UPS_PARAM_KEY_TYPE;
            param[0].value = UpsConst.UPS_TYPE_CUSTOM;

            compareCounter = 0;
            try {
                env.Create("ntest.db");
                db = env.CreateDatabase(1, 0, param);
                db.SetCompareFunc(new CompareFunc(MyCompareFunc));
                db.Insert(k, r);
                k[0] = 1;
                db.Insert(k, r);
                db.Close();
                env.Close();
            }
            catch (DatabaseException e) {
                Assert.Fail("unexpected exception " + e);
            }
            Assert.AreEqual(1, compareCounter);
        }
All Usage Examples Of Upscaledb.Database::Insert