C#从SQL Server导出到Excel [英] C# export to excel from sql server

查看:170
本文介绍了C#从SQL Server导出到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C#Windows应用程序中,我将sql服务器数据导出到远程驱动器上的excel。但这太慢了。
但是,如果我将数据导出到本地驱动器中的excel,速度很快。

In my C# windows application, I am exporting sql server data to excel on remote drive. But it is too slow. However, if I export data to excel in the local drive, it is fast.

如果要将数据导出到远程,如何增加时间

How can I increase the time if I want to export data to remote drive?

预先感谢...

推荐答案

导出到在本地计算机上的一个临时文件夹中,将其复制到网络,然后从该临时文件夹中删除该文件。您甚至可以在单独的线程上执行复制和删除操作,从而不会阻止用户界面。

Export to a temp folder on the local machine, copy it to the network and then delete the file from the temp folder. You could even do the copy and delete on a separate thread so the UI's not blocked.

这篇关于C#从SQL Server导出到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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