You can solve this case through code by using goto statement to retry again because dead lock happened in a very specific time while accessing database
public int update_anything()
{
try_again:
thisConnection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (SqlException exception)
{
MessageBox.Show(exception.Message);
if (exception.Number == 1205)
{
goto try_again; ;
}
else
{
throw;
}
}
finally
{
thisConnection.Close();
}
}