Exemple #1
0
        public static void updateAndAddTransaction()
        {
            IDbAccess db = IDbFactory.CreateIDb(connStr, dbType);

            try
            {
                db.IsTran = true;
                db.BeginTransaction();
                //add
                string    tableName = "templjqfortest";
                Hashtable ht        = new Hashtable();
                ht.Add("name", "hello db11");
                ht.Add("createtime", new DateTime(2011, 2, 1, 2, 2, 2, 11));
                ht.Add("supertiem", null);

                Console.WriteLine("" + db.AddData(tableName, ht));
                //delete
                string filterStr = "and name >='hello db7'";
                Console.WriteLine("delete is " + db.DeleteRow(tableName, filterStr));
                db.Commit();
            }
            catch (Exception e)
            {
                db.Rollback();
                db.Close();
            }
        }
Exemple #2
0
        public static void TestDeleteRow()
        {
            IDbAccess db        = IDbFactory.CreateIDb(connStr, dbType);
            string    tableName = "templjqfortest";
            string    filterStr = "and name >'hello db7'";

            db.DeleteRow(tableName, filterStr);
        }