MySqlBulkLoader的说明 [英] An Explanation of MySqlBulkLoader
问题描述
您能告诉我MySqlBulkLoader
是什么,在哪里以及如何使用?
请欣赏一些示例..
MySQLBulkLoader
是MySQL Connector/Net类中的一个类,用于包装MySQL语句LOAD DATA INFILE
.这使MySQL Connector/Net能够将数据文件从本地或远程主机加载到服务器. [ MySQLBulkLoader ] >
要明确:
MySQLBulkLoader
与SQLBulkCopy
不同. SQLBulkCopy
也称为Bulk insert
从DataTable
中读取数据,而MySQLBulkLoader
也称为LOAD DATA INFILE
从文件中读取.如果您有要在数据库中插入的数据列表,则可以直接使用SQLBulkCopy
在数据库内部准备和插入数据;使用MySQLBulkoader
的位置,您将需要在运行命令之前从数据中生成文件.
在撰写本文时,MySQL Connector/Net中没有SQLBulkCopy
的对应版本;但是,MySQL DB
支持Bulk insert
,因此您可以在MySQLCommand
中运行相应的命令,如显示的 解决方案
MySQLBulkLoader
is a class in the MySQL Connector/Net class that wraps the MySQL statement LOAD DATA INFILE
. This gives MySQL Connector/Net the ability to load a data file from a local or remote host to the server. [MySQLBulkLoader]
The example how to use the MySQLBulkLoader
is also presented Here
To be clear:
The MySQLBulkLoader
is not similar to SQLBulkCopy
. SQLBulkCopy
also called Bulk insert
reads data from DataTable
and MySQLBulkLoader
also called LOAD DATA INFILE
reads from a file. If you have a list of data to insert in you database, it is possible to prepare and insert data inside you database directly with SQLBulkCopy
; where with the MySQLBulkoader
you will need to genereate a file from your data before running the command.
There are no counterpart of SQLBulkCopy
inside MySQL Connector/Net at the time writting; however, the MySQL DB
support Bulk insert
, so you can run the corresponding command in a MySQLCommand
like presented Here.
这篇关于MySqlBulkLoader的说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!