내가 아는 한이 기본값을 변경할 방법이 없습니다. 하는 SqlCommand 생성자 코드는 다음이다 :
는
public SqlCommand()
{
this.ObjectID = Interlocked.Increment(ref _objectTypeCount);
this._commandTimeout = 30;
this._updatedRowSource = UpdateRowSource.Both;
this._prepareHandle = -1;
this._rowsAffected = -1;
this._notificationAutoEnlist = true;
GC.SuppressFinalize(this);
}
가능한 해결 방법은 인수로하는 SqlCommand 소요 생성자 인수로 전달하는 SqlCommand 소정를 사용하는 것이다.
그래서 당신은 (템플릿)
Dim commandTemplate60 = new SqlCommand()
commandTemplate60.Timeout = 60
와 직접 제한 시간을 설정
Dim cmd As New System.Data.SqlClient.SqlCommand(commandTemplate60)
그러나 60초
의 시간 제한과 명령을 필요로 할 때 다음, 아무튼 세계적인하는 SqlCommand를 만들 수 있습니다 't은 많은 일을하는 것 같다
[관련 질문] (http://stackoverflow.com/q/1001713/1178314) (dup로 플래그 지정하지 않음, 해당 질문에 중요한 차이가 있습니다. 둘 다 동일하다.) –