title: How to dispose ADODB.Command object in code migrated to VB.NET
body: <p>We migrated some obsolete code from VB6 to VB.net and the previous code used ADODB for connecting to oracle. Below is how the code looks like</p>
  
  <pre><code>Dim cmd As New ADODB.Command
  
  ' stored procedures execution here
  
  cmd = Nothing    // I want to dispose this cmd Object 
  </code></pre>
  
  <p><code>Nothing</code> worked in VB6 but its creating lot of trouble with .NET there are open cursors on database. I know we should use the latest library and get rid of ADODB but for now is there a way I can dispose this object. I tried <code>cmd.Dispose()</code> but that did not worked. </p>