I have a simple SQL script that I execute manually from Visual Studio. It is a data generation script so I expect it to take a couple of minutes to run. But I get the follow
Increasing the CommandTimeout property will solves the problem i.e.
SqlCommandObject.CommandTimeout = 500000