View Single Post
  #3 (permalink)  
Old November 9th, 2009, 12:02 AM
HungryCaterpillar HungryCaterpillar is offline
Registered User
 
Join Date: Nov 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Imar,

Thanks for the quick response. I tried removing "user instance=true" from my connection string and got the following error:

Code:
Server Error in '/' Application.
--------------------------------------------------------------------------------

CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\begASPNET\Release\App_Data\PlanetWrox.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. 
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: CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\begASPNET\Release\App_Data\PlanetWrox.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error: 

Line 23: 
Line 24:             Repeater1.DataSource = allGenres;
Line 25:             Repeater1.DataBind();
Line 26:         }
Line 27:     }
 
Source File: c:\begASPNET\Release\Reviews\AllByGenre.aspx.cs    Line: 25 

Stack Trace: 

[SqlException (0x80131904): CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\begASPNET\Release\App_Data\PlanetWrox.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4845255
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
I can't tell if this is due to a permissions error or just that I already have a PlanetWrox.mdf file in my App_Data folder.

To answer your questions, I am running this locally on my machine - that is, I'm using "http://localhost" as the URL in my browser to connect to it. Is that what you meant by "on the machine directly or using remote desktop" ?

Also, I ran my "sp_configure user instances enabled" command from my Microsoft SQL Server Mgmt Studio connected to <machine name>\SQLEXPRESS. I think I was using the master database.

Maybe I am actually using SQL Server 2005 instead of SQLExpress for my PlanetWrox database. I was just following the Try It Out instructions since Chapters 11 and 12 and assuming I was using SQLExpress, but maybe I've really been using SQL Server 2005 all along. The connection string has always had "sqlexpress" in it, though, just as entered on page 395.

I had read the article you referenced and reread it again more thoroughly. There's a few mentions of "modifying the sql server (sql express) service to use your local or system account", but I wasn't able to find the SQL Configuration Tools for SQLExpress mentioned, or any mention of SQLExpress in my Start menu or even in add/remove programs, so I couldn't try that. The only reference to sql express I can find is within my SQL Server Mgmt Studio. I'm using my work computer which had that preinstalled.

Maybe I should assume I'm using SQL Server 2005 and use your instructions in Appendix B to set up my site that way ? Sorry to sound so clueless.


Thanks,

Geoff
Reply With Quote