The database 'DB Name' is not accessible.
        Posted  
        
            by Gurucharan
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Gurucharan
        
        
        
        Published on 2010-06-13T16:37:40Z
        Indexed on 
            2010/06/13
            16:42 UTC
        
        
        Read the original article
        Hit count: 199
        
I am getting following error each time I tried to select database. The database 'DB Name' is not accessible. (Microsoft.SqlServer.Express.ObjectExplorer)
Note: My OS is Win Vista.
When I tried to open SQL Mgmt Studio as Run as administrator than I can able to access database properly.
Any idea why it is giving error.
I am also getting following error when my asp.net application is trying to access database.
Cannot open database "DBName" requested by the login. The login failed. Login failed for user 'PCName\abcd'.
I am not very good with SQL Server, please let me know how to create user and grant them permission in case that is what causing the problem.
Thanks.
© Stack Overflow or respective owner