C# windows service sometimes hangs on Executing sql update
<p>I am doing a simple update, of a bit in a table using the code below.  However, sometimes the program hangs on myCommand.ExecuteNonQuery();  and I don't know why.  If Sql server is down, it will drop into the catch statement as expected but sometimes, for seemingly no reason, it will just hang on the execution statement.  Any Ideas.... Some of my code is below.</p>

<p>Thanks</p>

<p>SqlCommand myCommand = new SqlCommand(sqlCommand);
            connection = new SqlConnection(constr);
            myCommand.CommandType = CommandType.Text;</p>

<pre><code>        myCommand.Connection = connection;

        try
        {
            connection.Open();
            myCommand.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            throw new Exception("There was an inserting information from the Sql server&lt;br&gt;" +
                "The server error was: &lt;br&gt;" + ex.Message + "&lt;br&gt;");  

        }
        finally
        {
            this.CloseConnection();
        }
</code></pre>
