예제 #1
0
        public static void InsertCollection(List <Bill_Identifier> identifers)
        {
            var sql_accumulator = new StringBuilder(); // Accumulate SQL statements here, submit as single statement
            var accumulated     = 0;

            foreach (var identifier in identifers)
            {
                if (accumulated >= SQL_INSERT_ROW_LIMIT)
                {
                    FlushAccumulator(sql_accumulator);
                    accumulated = 0;
                }
                sql_accumulator.Append($" ({BillRow.RowToColumns(new BillRow(identifier))}),");
                accumulated++;
            }
        }
예제 #2
0
        public static void Insert(BillRow row, StringBuilder sql_accumulator)
        {
            var non_query = $"Insert Into [{table_Name}] ({BillRow.Columns()}) Values ({BillRow.RowToColumns(row)});";

            DB.NonQuery(non_query, "BillRowsTable.Insert");
        }