SQL 2005 (not express) installing problem

Sep 22, 2008 at 10:26 AM

I've attached the mdf file and run this sql script:

use master
go

Begin Try
CREATE LOGIN dropthings
WITH PASSWORD = 'dropthings',
CHECK_POLICY = OFF;
End Try
Begin Catch
PRINT 'User dropthings already in SQL Server, which is fine'
End Catch

USE Dropthings
go
Begin Try
CREATE USER dropthings;
End Try
Begin Catch

 

Msg 911, Level 16, State 1, Line 12

Could not locate entry in sysdatabases for database 'Dropthings'. No entry found with that name. Make sure that the name is entered correctly.

User dropthings already in Database, which is fine

The number of orphaned users fixed by updating users was 0.

The number of orphaned users fixed by adding new logins and then updating users was 0.

 

And when I try to access the site in my browser I get an login error message:

Cannot open database "dropthings" requested by the login. The login failed.
Login failed for user 'dropthings'.

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 "dropthings" requested by the login. The login failed.
Login failed for user 'dropthings'.

Source Error:

Line 34:             get
Line 35:             {
Line 36: return ((bool)(this.GetPropertyValue("IsFirstVisit")));Line 37:             }
Line 38:             set

Source File: c:\Inetpub\wwwroot\myportal\App_Code\UserProfile.cs    Line: 36

PRINT 'User dropthings already in Database, which is fine'
End Catch
go

sp_change_users_login 'auto_fix', 'dropthings'
GO

But I get an error when I run this script.

Sep 24, 2008 at 8:15 PM
Edited Sep 24, 2008 at 8:16 PM
In order to fix this problem you need to change your connection string information to that which was provided by your hosting company. And make sure that the Dropthings.mdf is attached which i see that you have already done. One last thing you'll also need to set debuging to false.

Hope this helps
Feb 18, 2009 at 2:39 PM
Any other suggestions, I am also having this problem.  We run VS 2005 and I'm trying to set the database to run on Windows Authentication. so my connection string looks like connectionString="Data Source=DatabaseServer;initial catalog=DatabaseName;Integrated Security=sspi;