best way of executing long run query in

Last Reply on Mar 15, 2018 01:09 AM By Gayatri

Posted on Mar 15, 2018 12:49 AM

How to run long run query in

When i run the query timeout occurs and stop working. I have set command time out also but same problem occurs

Posted on Mar 15, 2018 12:52 AM

Default connection time is 30 secs.

As you are facing a timout on your command, therefore you need to increase the timout of your sql command. You can specify it in your command like this.

// Setting command timeout to 2 minutes
cmd.CommandTimeout = 120


Posted on Mar 15, 2018 01:09 AM

Try this

modify connection string in web config

Connection Timeout=120;Connection Lifetime=180;Min Pool Size=0;Max Pool Size=1000;Pooling=true