title: Attached database file and "The login failed" error
body: <p>I implement a windows application and a windows service with an attached database file for both of them with this connection string:</p>
  
  <pre><code>Data Source=.\SQLExpress;AttachDbFilename=d:\Resources\SamaDB.mdf;Database=SamaDB;Integrated Security=SSPI;User Instance=True
  </code></pre>
  
  <p>It seems that every things are ok. The windows application runs well when the windows service is stopped, But when the windows service application starts, The windows application raised the bellow error :</p>
  
  <pre><code>"Cannot open database 'SamaDB' requested by the login. The login failed.
  Login failed for user '026-36661762\PouyanComputer'". 
  </code></pre>