如何使用C#批量插入MySQL
我之前使用 SQLBulkCopy 类将数据加载到 MS SQL Server 数据库中。结果非常好,并且完全按照我的预期进行。
现在,我尝试使用 SSIS 中的脚本任务,使用 ODBC 或 ADO.NET 连接(推荐?)将数据批量加载到 MySQL (5.5.8) 数据库中。
我的数据集中的列与 MySQL 表的列相对应。将数据集批量插入 MySQL 数据库的最佳方法是什么?
I have previously used the SQLBulkCopy class to load data into a MS SQL Server db. The results were very good, and worked exactly as I intended it to.
Now, I'm trying to use a script task in SSIS to bulk load data into a MySQL (5.5.8) database using either an ODBC or ADO.NET connection (recommend?).
The columns in my dataset correspond with the columns of the MySQL table. What is the best way to do a bulk insert of a dataset into a MySQL database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 MySQL Connector for .NET 附带的 MySqlBulkLoader:
You can use the MySqlBulkLoader shipped with the MySQL Connector for .NET: