SessionStateSection.SqlCommandTimeout Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur batas waktu durasi untuk perintah SQL menggunakan mode status sesi 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
Nilai Properti
Jumlah waktu, dalam detik, setelah itu perintah SQL akan kehabisan waktu. Defaultnya adalah 30 detik.
- Atribut
Contoh
Contoh kode berikut menunjukkan cara mendapatkan SqlCommandTimeout properti. Lihat contoh kode dalam SessionStateSection topik kelas untuk mempelajari cara mengakses SessionStateSection objek.
// Display the current SqlCommandTimeout property value.
Console.WriteLine("SqlCommandTimeout: {0}",
sessionStateSection.SqlCommandTimeout);
' Display the current SqlCommandTimeout property value.
Console.WriteLine("SqlCommandTimeout: {0}", _
sessionStateSection.SqlCommandTimeout)