Database not working

Last post 01-24-2008 10:11 AM by dhanabalanr. 1 replies.

Sort Posts:

  • Database not working

    01-24-2008, 9:10 AM
    • Loading...
    • aspkimy
    • Joined on 01-21-2008, 11:22 PM
    • Posts 10

    All,

     I use commerce starter kit software. When I run the application throught visual studio 2008, it runs fine. But when I connect the database through ms sql management studio express. The application is not working and I get these error messages below. Eventhought I disconnect the database from ms sql management studio. It sitll not working. Thanks for any helps. My environment are vista, visual studio 2008, ms sql 2005 express, ms sql management studio express.

    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 user default database. Login failed.
    Login failed for user 'sotee-PC\sotee'.

    Source Error:

    Line 118:        {
    Line 119:            cmd.CommandType = CommandType.StoredProcedure;
    Line 120:            cnn.Open();
    Line 121:        }
    Line 122:        return cmd.ExecuteReader(CommandBehavior.CloseConnection);
     Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 

  • Re: Database not working

    01-24-2008, 10:11 AM
    Answer
    • Loading...
    • dhanabalanr
    • Joined on 09-23-2007, 9:38 AM
    • India
    • Posts 181

    Hi, 

    Every user has a default database specified. If you are using a SQLConnectinstring you are normally redirecting the user within the connectionstring to a specific database (Initial Catalog). By connecting with another tool which does not have the availbility to choose a starting database the user is redirected to its "home" / default database. If the database was dropped in the meantime, or the user was denied access / or even not granted, the login procedure will fail. You can set the user defaults database with using the procedure sp_defaultdb or by using any gui which can administer the logins.

    HTH

    With Luv
    Dhana

    Dont forget to mark as answer if my reply helped you...



Page 1 of 1 (2 items)
Microsoft Communities
Page view counter