前面写过两篇excel操作的文章,有朋友质疑大批量数据下的性能问题,这个时候最好用批量复制的方法,可以用excel的QueryTable来直接查询数据库,但是必须引用com组件。
参考代码:
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Reflection;
- using Excel = Microsoft.Office.Interop.Excel;
- namespace ConsoleApplication18
- {
- class Program
- {
- static void Main(