简体   繁体   中英

Httpruntime- ExecutionTimeOut

I'm getting timeout error while importing large number of fields from CSV file. While importing it refers the timeout which is configured in

We cannot predict the number of fields from CSV file, some times a large number files will be processing in live environment. I wanted to set Maximum time out in this import logic until it reaches the end of the file. Our client will not mind the time which we configured for import logic, our goal should import all the fileds without time out error.

In googling, I found that we can set a timeout through the following statement with the specified duration,

HttpContext.Current.Server.ScriptTimeout = 360;

But we cannot predict the time which required for importing the large CSV file. How we can configure the maximum timeout through C# code, instead of setting through web.config.

Thanks in Advance!!

Web.config文件中使用此代码可以增加ExecutionTimeOut

<httpRuntime targetFramework="4.5.1" maxRequestLength="2097151" useFullyQualifiedRedirectUrl="true"         executionTimeout="14400" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM