简体   繁体   中英

Sql connection for executing query

  1. I have more than 12k records.
  2. Default configured is 30 sec for connection time out. In this scenario i am getting exception like sql connection time out is closed.
  3. I configured connection time out 0 for executing from c#.
  4. Any disadvantage for set to value is 0.

Please suggest which value is fine for connection timeout. Please keep in mind I have huge data like 12k to 50k.

A value of 0 indicates no limit, and should be avoided in a ConnectionString because an attempt to connect waits indefinitely.

Making connection depends on database,drivers, it is local or remote. You can not pin point some specific value knowing all these things. value doesn't depends on number of records.

if some problem occur while processing some specific record and it takes too long and you don't want to wait for so long in order to save time. Set CommandTimeout property but it has nothing to do with connection state

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