Created
September 17, 2015 14:52
-
-
Save DominicFinn/899dcb40ec8a085ce187 to your computer and use it in GitHub Desktop.
ADO.NET command timeout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Data | |
open System.Data.SqlClient | |
let cn = new SqlConnection("Data Source=;Initial Catalog=;Persist Security Info=True;User ID=;Password=") | |
cn.Open() | |
let command = new SqlCommand("WAITFOR DELAY '00:00:04';select * from sys.tables", cn) | |
command.CommandTimeout <- 1 // will break | |
command.ExecuteNonQuery() |> ignore | |
cn.Close() | |
printfn "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment