无法写入.CSV文件
问题描述:
大家好,
我有1个在本地系统上运行的项目,当我单击导出"按钮时,它会调用一个开始在服务器上运行的exe.
此exe将从sql数据库中收集数据,并将数据写入.csv文件中.
现在,此文件将作为附件发送给在代码中指定了ID的用户.
问题从大数据开始.用户收到小数据的邮件,但是当数据大到600行时,既不会创建csv文件,也不会将其邮寄给任何用户?
Hi Guys,
I have 1 project which is running on local system and when I click on export button it calls an exe which starts running on server.
This exe will collect the data from sql database and write the data in .csv file.
Now this file will be send as an attachment to the users whose id is specified in the code.
Problem starts with the large data.Users get the mail for small data but when the data is large around 600rows then neither csv file is created nor it is mailed to any user?
答
您可能会在数据库中遇到超时问题.
我非常怀疑您在服务器上运行的是exe.您实际上是否只是单击网页上的一个按钮,然后该按钮消失了,服务器上的代码背后是否需要进行处理?
如果您遇到的问题仅与600行左右的记录集超时有关,那么您可能需要研究优化用于查询数据的查询.
You are likely running into a timeout issue in the database.
I very much doubt you are running an exe on the server. Are you actually just clicking on a button in a web page that then goes off and the code-behind on the server does the processing you require?
If you are running into problems relating to timeouts on recordsets that are only 600 or so rows then you may need to look into optimizing the queries used to query the data.