title: Does DataAdapter.Fill() close its connection when an Exception is thrown?
body: <p>I am using ADO.NET (.NET 1.1) in a legacy app. I know that DataAdapter.Fill() opens and closes connections if the connection hasn't been opened manually before it's given to the DataAdapter.</p>
  
  <p>My question: <strong>Does it also close the connection if the .Fill() causes an Exception?</strong> (due to SQL Server cannot be reached, or whatever). Does it leak a connection or does it have a built-in Finally-clause to make sure the connection is being closed.</p>
  
  <p>Code Example:</p>
  
  <pre><code>Dim cmd As New SqlCommand
  Dim da As New SqlDataAdapter
  Dim ds As New DataSet
  cmd.Connection = New SqlConnection(strConnection)
  cmd.CommandText = strSQL
  da.SelectCommand = cmd
  da.Fill(ds)
  </code></pre>