1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
Dim cnx As New SqlClient.SqlConnection
cnx.ConnectionString = "server=MY_LOCAL_SERVER;Trusted_Connection=yes;MultipleActiveResultSets=True"
cnx.Open()
' Ne fonctionne pas
cmd.CommandText = "UPDATE [MY_LINKED_SERVER].[MYDB].[dbo].[MYTABLE] SET Foo = @foo WHERE id = @id"
cmd.Parameters.AddWithValue("@foo", "bar")
cmd.Parameters.AddWithValue("@id", "10")
cmd.CommandTimeout = 240
cmd.ExecuteNonQuery() ' Timeout exception
' Fonctionne instantanément
cmd.CommandText = "UPDATE [MY_LINKED_SERVER].[MYDB].[dbo].[MYTABLE] SET Foo = 'bar' WHERE id = @id"
cmd.Parameters.AddWithValue("@id", "10")
cmd.CommandTimeout = 240
cmd.ExecuteNonQuery() |
Partager