Changing SqlConnection timeout

后端 未结 10 2148
孤街浪徒
孤街浪徒 2020-12-25 09:22

I am trying to override the default SqlConnection timeout of 15 seconds and am getting an error saying that the

property or indexer cann

10条回答
  •  盖世英雄少女心
    2020-12-25 10:08

    I found an excellent blogpost on this subject: https://improve.dk/controlling-sqlconnection-timeouts/

    Basically, you either set Connect Timeout in the connection string, or you set ConnectionTimeout on the command object.

    Be aware that the timeout time is in seconds.

提交回复
热议问题