如何在不使用循环的情况下使用OLEDB连接将批量数据从Excel文件插入Ms Access数据库。我在C#windows应用程序中使用OLEDB连接? [英] How can I insert bulk data from an Excel file to Ms Access data base using OLEDB connection without using loops. I'm using OLEDB connection in a C# windows application?

查看:92
本文介绍了如何在不使用循环的情况下使用OLEDB连接将批量数据从Excel文件插入Ms Access数据库。我在C#windows应用程序中使用OLEDB连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用循环的情况下使用OLEDB连接将批量数据从Excel文件插入Ms Access数据库。我在C#windows应用程序中使用OLEDB连接?

How can I insert bulk data from an Excel file to Ms Access data base using OLEDB connection without using loops. I'm using OLEDB connection in a C# windows application?

推荐答案

对于MS Access,没有SqlBulkCopy [ ^ ]。



这意味着您的问题的答案是:您不能。



如果您需要表现, MS Access不是正确的选择。如果您想坚持使用MS Access,则必须使用循环。如果你愿意使用DAO而不是OleDB,你可能会获得一些显着的性能提升,因为这个链接暗示:

http://stackoverflow.com/questions/7070011/writing-large-number-of-records-bulk- insert-to-access-in-net-c [ ^ ]
There is no bulk insert method for MS Access in the meaning of SqlBulkCopy[^] for Sql-Server.

Which means the answer to your question is: you can not.

If you need performance, MS Access is not the right choice. If you want to stick with MS Access, you will have to use loops. If you're willing to use DAO instead of OleDB you probably can gain some significant performance increase though, as this link suggests:
http://stackoverflow.com/questions/7070011/writing-large-number-of-records-bulk-insert-to-access-in-net-c[^]


这篇关于如何在不使用循环的情况下使用OLEDB连接将批量数据从Excel文件插入Ms Access数据库。我在C#windows应用程序中使用OLEDB连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆