Udostępnij za pośrednictwem


SessionStateSection.SqlCommandTimeout Właściwość

Definicja

Pobiera lub ustawia limit czasu trwania dla poleceń SQL przy użyciu trybu stanu sesji programu SQL Server.

public:
 property TimeSpan SqlCommandTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("sqlCommandTimeout", DefaultValue="00:00:30")]
public TimeSpan SqlCommandTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsOrInfiniteConverter))>]
[<System.Configuration.ConfigurationProperty("sqlCommandTimeout", DefaultValue="00:00:30")>]
member this.SqlCommandTimeout : TimeSpan with get, set
Public Property SqlCommandTimeout As TimeSpan

Wartość właściwości

Czas w sekundach, po którym upłynął limit czasu polecenia SQL. Wartość domyślna to 30 sekund.

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak pobrać SqlCommandTimeout właściwość. Zapoznaj się z przykładem kodu w temacie SessionStateSection klasy, aby dowiedzieć się, jak uzyskać dostęp do SessionStateSection obiektu.

// Display the current SqlCommandTimeout property value.
Console.WriteLine("SqlCommandTimeout: {0}",
  sessionStateSection.SqlCommandTimeout);
' Display the current SqlCommandTimeout property value.
Console.WriteLine("SqlCommandTimeout: {0}", _
  sessionStateSection.SqlCommandTimeout)

Dotyczy