Relative Content

Tag Archive for c#azure-sql-database.net-4.8retrypolicy

how to use RetryLogicProvider for connection lost during command

I’m using SqlRetryLogicBaseProvider to define my retries for a SQL Azure .Net Framework 4.8 win forms application. I’m just starting to understand the underlying mechanisms by performing simple disconnection tests. I also have some customers with a very unstable internet, so loosing the internet connection when performing a command might be an issue. So I added error code 11001 to the transient error list. However, I just don’t get the right way to configure the retry logic. If the internet is lost when opening the connection, everything is “fine”, connection.open gets retried. But if the internet is lost when perfoming command.ExecuteReader() an error is thrown after the first retry of the command and there is no retry on the connection.