title: Error when connecting to a SQL database: Cannot open database "Students.mdf" requested by the login. The login failed
body: <p>I am really frustrated, this is very simple but didn't work with me. I'm trying to connect to my SQL Server which I don't need username and password when running SSMS. My server name is <code>HP\SQLEXPRESS</code> and I'm using the following connection string: </p>
  
  <pre><code>string connectionString = "Data Source=HP\\SQLEXPRESS;Initial Catalog=Students.mdf;Integrated Security=SSPI;";
  </code></pre>
  
  <p>and I get the following error: </p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll</p>
    
    <p>Additional information: Cannot open database "Students.mdf" requested by the login. The login failed.</p>
    
    <p>Login failed for user 'HP\Aymen'.</p>
  </blockquote>
  
  <p>And when I specify the full address of my database as follows: </p>
  
  <pre><code>string connectionString = "Data Source=HP\\SQLEXPRESS;Initial Catalog=c:\\Program Files\\Microsoft SQL Server\\MSSQL11.SQLEXPRESS\\MSSQL\\DATA\\Students.mdf;Integrated Security=SSPI;";
  </code></pre>
  
  <p>it also gives me the same error. </p>
  
  <p>Any suggestion? </p>