Page view counter

Error when i run Storefront

Last post 10-05-2008 2:32 AM by hack2root. 2 replies.

Sort Posts:

  • Error when i run Storefront

    08-31-2008, 10:53 PM
    • Loading...
    • F2F83
    • Joined on 10-11-2007, 10:21 AM
    • Posts 7
    • Points 2

     Hi, Everybody !

    i download code of Storefront ,run it in my computer and i have a issue. error messeage is

     

    Cannot open database "AdventureWorks" requested by the login. The login failed.<br>Login failed for user 'HOME-83894A263C\Home'.BODY { FONT-WEIGHT: normal; FONT-SIZE: 0.7em; COLOR: black; FONT-FAMILY: "Verdana" } P { MARGIN-TOP: -5px; FONT-WEIGHT: normal; COLOR: black; FONT-FAMILY: "Verdana" } B { MARGIN-TOP: -5px; FONT-WEIGHT: bold; COLOR: black; FONT-FAMILY: "Verdana" } H1 { FONT-WEIGHT: normal; FONT-SIZE: 18pt; COLOR: red; FONT-FAMILY: "Verdana" } H2 { FONT-WEIGHT: normal; FONT-SIZE: 14pt; COLOR: maroon; FONT-FAMILY: "Verdana" } PRE { FONT-SIZE: 0.9em; FONT-FAMILY: "Lucida Console" } .marker { FONT-WEIGHT: bold; COLOR: black; TEXT-DECORATION: none } .version { COLOR: gray } .error { MARGIN-BOTTOM: 10px } .expandable { FONT-WEIGHT: bold; CURSOR: hand; COLOR: navy; TEXT-DECORATION: underline }

    Cannot open database "AdventureWorks" requested by the login. The login failed.
    Login failed for user 'HOME-83894A263C\Home'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot open database "AdventureWorks" requested by the login. The login failed.
    Login failed for user 'HOME-83894A263C\Home'.

    Source Error:

    Line 6:            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("server=.\\SQLExpress;database=AdventureWorks;Integrated Security=true");
    Line 7:            System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT * FROM Person.StateProvince WHERE CountryRegionCode='US' ORDER BY StateProvinceCode", conn);
    Line 8:            conn.Open();
    Line 9:            using (System.Data.SqlClient.SqlDataReader rdr = cmd.ExecuteReader()) {
    Line 10:               while (rdr.Read()) {
     

    My app.config:

     

    <connectionStrings>
            <add name="Commerce.MVC.Data.Properties.Settings.Commerce_MVCConnectionString3"
                connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=E:\project\2008\mvcsamples-14811\Commerce.Web\App_Data\Commerce.MVC.mdf;Initial Catalog=Commerce.MVC;Integrated Security=True;User Instance=True"
                providerName="System.Data.SqlClient" />
            <add name="Commerce.MVC.Data.Properties.Settings.Commerce_MVCConnectionString"
                connectionString="Data Source=localhost;Initial Catalog=Commerce.MVC;Integrated Security=True"
                providerName="System.Data.SqlClient" />
            <add name="Commerce.MVC.Data.Properties.Settings.Commerce_MVCConnectionString1"
                connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=E:\project\2008\mvcsamples-14811\Commerce.Web\App_Data\Commerce.MVC.mdf;Integrated Security=True;User Instance=True"
                providerName="System.Data.SqlClient" />
            <add name="Commerce.MVC.Data.Properties.Settings.Commerce_MVCConnectionString2"
                connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=E:\project\2008\mvcsamples-14811\Commerce.Web\App_Data\Commerce.MVC.mdf;Integrated Security=True;User Instance=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>

     

    What should i do to solve this issue?

    thanks all.

  • Re: Error when i run Storefront

    09-01-2008, 7:02 PM
    • Loading...
    • tgmdbm
    • Joined on 12-17-2007, 2:08 PM
    • Posts 815
    • Points 3,797
    • ASPInsiders

    Download and install the adventureworks database

    http://msdn.microsoft.com/en-us/library/aa992075(VS.80).aspx

    http://go.microsoft.com/fwlink/?linkid=31046

    Then make sure the connection string is valid.

  • Re: Error when i run Storefront

    10-05-2008, 2:32 AM
    • Loading...
    • hack2root
    • Joined on 04-23-2008, 1:43 AM
    • Ufa, Russian Federation
    • Posts 1
    • Points 2

    F2F83:
            <add name="Commerce.MVC.Data.Properties.Settings.Commerce_MVCConnectionString"
                connectionString="Data Source=localhost;Initial Catalog=Commerce.MVC;Integrated Security=True"
                providerName="System.Data.SqlClient" />

     As an alternative you can search and download Microsoft Sample Databases from CodePlex http://www.codeplex.com

Page 1 of 1 (3 items)