The default timeout is 30s... You may try:
1. Plus "Timeout=XX" in your connection string, where XX is seconds2. Set both Connection.ConnectionTimeout and Command.ConnectionTimeout
Hope this helps.
You need to set the "CommandTimeout" parameter before you open the connection.
change theLock_TimeOut in the remote stored procedure.SET LOCK_TIMEOUT 3000 --3 seconds
May be this will solve your error.
1) You can not set ConnectionTimeout in code, it mus be done in the connection string (Connect Timeout =30).2) To modify the command timeout set the CommandTimeout property: SqlCommand command = new SqlCommand ("myLoadProc", myConnection); command.CommandTimeout = 180; //3 minutes . . . command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@param1", this.Param ) ); adapter.SelectCommand = command; adapter.Fill( ds ); command.ResetCommandTimeout();3) It seems, from the writings, that is a good idea to reset the colmmand timeout after finishing the command to the default . . .
just set the command timeout parameter before you open any connection by using SQL command like SqlCommand command = new SqlCommand (); and set command.CommandTimeout = 180; and other variables like load profiles and connections to the server. This will solve your problem.