title: "Using" for object returned by function
body: <p>I want use an SQLite connection for only a very short time.</p>
  
  <p>Because I do this very often for different DBs, I wanted to create a function for that:</p>
  
  <pre><code>Public Function ConnectionFromPath(ByVal uDBPath As String) As SQLite.SQLiteConnection
  
      Dim nConn As New SQLite.SQLiteConnection
      With nConn
          .ConnectionString = "Data source=" &amp; uDBPath
          .Open()
      End With
  
      Return nConn
  
  End Function
  </code></pre>
  
  <p>Usually, I use "Using... End Using" for SQLite.SQLiteConnection</p>
  
  <p>Now I simply say:</p>
  
  <pre><code>Using nCn As SQLite.SQLiteConnection = modDB.ConnectionFromPath(uDBPath)
      'Do something with it
  End Using 'This should automatically close the db and free the file
  </code></pre>
  
  <p>Is it so easy, and my function "inherits" the "Using" from the SQLite.SQLiteConnection's "usability", or did I miss anything?</p>