title: SQL Server DB tasks, Detach, Backup and Restore
body: <p>I am attaching My DB through vb.net code.  </p>
  
  <p>Now I request help for the following:</p>
  
  <ol>
  <li>How to detach it using code (<code>uid=sa, pwd=abc123</code>)?</li>
  <li>How to take backup?</li>
  <li>How to restore backup?</li>
  </ol>
  
  <p>Please note I want to do it all using vb.net code</p>
  
  <p>Thanks a lot.</p>