Total Pageviews

Tuesday 6 January 2015

Web.config

Error: Cannot open database “computer_store.mdf” requested by the login. The login failed. Login failed for user 'AKASH\prakash'.

Solution: Check it should not have two connections for db.mdf or db studio management  . So , i commented the two connection strings.(<!-- comment  -->)

Eg:

<connectionStrings>
    <!--<remove name="LocalSqlServer" />
 <add name="LocalSqlServer" connectionString="Data Source=AKASH\SQLEXPRESS;Initial Catalog=computer_store;Integrated Security=True"
   providerName="System.Data.SqlClient" />
  <add name="computer_store_CS" connectionString="Data Source=AKASH\SQLEXPRESS;Initial Catalog=computer_store;Integrated Security=True"
   providerName="System.Data.SqlClient" />-->
  <add name="ConnectionString_mdf" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\computer_store.mdf;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />
 </connectionStrings>
<system.web>