1

Background:

I'm trying to get the Live Demos of Telerik's Rad Controls for ASP.NET AJAX working on my local machine in IIS 7. I'm getting an error when I view the ComboBox demo.

Error I get:

Server Error in '/' Application .... CREATE DATABASE permission denied in database 'master'. An attempt to attach an auto-named database for file C:\Users\MacGyver\MyDocuments\Visual Studio 2008\Projects\TelerikDemos\Telerik\RadControls for ASP.NET AJAX Q2 2011\Live Demos\App_Data\Northwind.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Same error is here:
(search for "THE SOLUTION IS HERE" .. half way down in huge font)

http://social.msdn.microsoft.com/forums/en-US/sqlexpress/thread/6dfdcc22-7a81-4e8f-a947-c1ce6982d4b3/

I'm on Windows 7.. slightly different clicks, but same problem I'm guessing. I get to the "Advanced Security Settings for App_Data" window, and I have two check boxes. Initially, the "Include inheritable permissions from this object's parent" (box 1) box is checked. But the "Replace all child object permissions with inheritable permissions from this object" (box 2) is unchecked. When I try checking box 2, and click "Apply", it doesn't stay checked. Why would this be?

===================================

9/9/2011 update @ 9:19am

Here are my connection strings:

<connectionStrings>
<add name="NorthwindConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
    <add name="TelerikConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
    <add name="NorthwindConnectionString35" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
    <add name="TelerikConnectionString35" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
    <add name="NorthwindEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="TelerikEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Telerik.mdf;Integrated Security=True;User Instance=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="QSFRatingsConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|QSFRatings.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
    <add name="SelfReferencingDbConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|TelerikSelfReferencingDb.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
</connectionStrings>

Here is a screen shot of the files in App_Data:

enter image description here

2 Answers 2

1

Sounds like you already have a database on the instance called Northwind.

See this link for more details on entire setup, issues and solution:

https://stackoverflow.com/questions/7366295/sqlexpress-connection-fails-in-iis-7-w-user-instance-error-failed-to-generate

6
  • These are *.mdf files in the App_Data folder that the site is reading from. I did in fact have the Telerik and Northwind databases that I attached in DEV-SQL-MAC\SQLEXPRESS yesterday because I didn't realize you could read directly from the files in the web_root\App_Data folder directly. But after you added this answer, I removed the ones I attached (expecting just the files in the App_Data folder to be used) and it is still giving me the same error. The article above explains it's a permissions problem, but tried different combinations and couldn't resolve. Any other ideas? Sep 9, 2011 at 14:17
  • I'll add my connection strings.. that might show more. Sep 9, 2011 at 14:18
  • You don't need the "AttachDbFilename=|DataDirectory|\Northwind.mdf" section of the connection string as the database is already attached.
    – mrdenny
    Sep 9, 2011 at 20:25
  • Figured out this all works great when running under Visual Studio's play button (ASP.NET Development Server). So that attribute can stay in that case, can't it? See this new question for more details: stackoverflow.com/questions/7366295/… Sep 9, 2011 at 20:31
  • 2
    You wouldn't want to deploy an application with the AttachDbFilename parameter. This is telling the driver to attach the database. If the database doesn't exist on the server that could cause errors to be thrown.
    – mrdenny
    Sep 9, 2011 at 20:36
0

I prepended "Initial Catalog=uniquenamehere;" to the connection string, that solved it:

  <connectionStrings>
    <add name="Northwind" connectionString="metadata=res://*/Models.Northwind.csdl|res://*/Models.Northwind.ssdl|res://*/Models.Northwind.msl;provider=System.Data.SqlClient;provider connection string=&quot;Initial Catalog=uniquenamehere;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Northwind.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .