Esempio n. 1
0
        internal void OdbcBulkInsert(ITableData data, string tableName, BulkInsertSql bulkInsert)
        {
            string sql = bulkInsert.CreateBulkInsertStatement(data, tableName);
            var    cmd = DbConnection.CreateCommand();

            cmd.Transaction = Transaction as OdbcTransaction;
            cmd.Parameters.AddRange(bulkInsert.Parameters.ToArray());
            cmd.CommandText = sql;
            cmd.ExecuteNonQuery();
        }
Esempio n. 2
0
        public override void BulkInsert(ITableData data, string tableName)
        {
            BulkInsertSql bulkInsert = new BulkInsertSql()
            {
                UseParameterQuery = true,
                //ConnectionType = ConnectionManagerType.SqlServer
            };

            OdbcBulkInsert(data, tableName, bulkInsert);
        }
Esempio n. 3
0
        public override void BulkInsert(ITableData data, string tableName)
        {
            BulkInsertSql bulkInsert = new BulkInsertSql()
            {
                ConnectionType       = ConnectionManagerType.Access,
                AccessDummyTableName = DummyTableName,
                UseParameterQuery    = true
            };

            OdbcBulkInsert(data, tableName, bulkInsert);
        }
Esempio n. 4
0
        public override void BulkInsert(ITableData data, string tableName)
        {
            BulkInsertSql bulkInsert = new BulkInsertSql()
            {
                UseParameterQuery = true
            };
            string sql = bulkInsert.CreateBulkInsertStatement(data, tableName);
            var    cmd = DbConnection.CreateCommand();

            cmd.Parameters.AddRange(bulkInsert.Parameters.ToArray());
            cmd.CommandText = sql;
            cmd.ExecuteNonQuery();
        }
Esempio n. 5
0
        protected override void DoBulkInsert(ITableData data)
        {
            BulkInsertSql <MySqlParameter> bulkInsert = new BulkInsertSql <MySqlParameter>()
            {
                UseParameterQuery = true,
                ConnectionType    = ConnectionManagerType.MySql
            };
            string sql = bulkInsert.CreateBulkInsertStatement(data, data.Definition.Name);
            var    cmd = DbConnection.CreateCommand();

            cmd.Parameters.AddRange(bulkInsert.Parameters.ToArray());
            cmd.CommandText = sql;
            cmd.Prepare();
            cmd.ExecuteNonQuery();
        }
Esempio n. 6
0
        public override void BulkInsert(ITableData data, string tableName)
        {
            BulkInsertSql <MySqlParameter> bulkInsert = new BulkInsertSql <MySqlParameter>()
            {
                UseParameterQuery = true,
                ConnectionType    = ConnectionManagerType.MySql
            };
            string sql = bulkInsert.CreateBulkInsertStatement(data, tableName);
            var    cmd = DbConnection.CreateCommand();

            cmd.Transaction = Transaction as MySqlTransaction;
            cmd.Parameters.AddRange(bulkInsert.Parameters.ToArray());
            cmd.CommandText = sql;
            cmd.Prepare();
            cmd.ExecuteNonQuery();
        }
 protected override void DoBulkInsert(ITableData data)
 {
     TryDropDummyTable();
     CreateDummyTable();
     try
     {
         BulkInsertSql bulkInsert = new BulkInsertSql()
         {
             ConnectionType       = ConnectionManagerType.Access,
             AccessDummyTableName = DummyTableName,
             UseParameterQuery    = true
         };
         string sql = bulkInsert.CreateBulkInsertStatement(data, data.Definition.Name);
         var    cmd = DbConnection.CreateCommand();
         cmd.Parameters.AddRange(bulkInsert.Parameters.ToArray());
         cmd.CommandText = sql;
         cmd.ExecuteNonQuery();
     }
     finally
     {
         TryDropDummyTable();
     }
 }