This is a migrated thread and some comments may be shown as answers.

Error trying to run live demo application installed on my machine.

8 Answers 337 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve Holdorf
Top achievements
Rank 1
Steve Holdorf asked on 15 Aug 2011, 12:15 AM
When I try to run the demo website on my machine I get the following error:

Database 'C:\PROGRAM FILES\TELERIK\RADCONTROLS FOR ASP.NET AJAX Q1 2011\LIVE DEMOS\APP_DATA\NORTHWIND.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
An attempt to attach an auto-named database for file C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q1 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.


I have uninstalled and restalled the 2011 ajax version and am still having the same problem. I did install mysql on my machine today and uninstalled sql server 2008, then removed 2005 and reinstalled sql server 2008. Am running vs studio 2010 professional trial.

Please assist.


Thanks,


Steve Holdorf

8 Answers, 1 is accepted

Sort by
0
Steve Holdorf
Top achievements
Rank 1
answered on 15 Aug 2011, 02:24 AM
Also, here is the stack trace:

Exception Details: System.Data.SqlClient.SqlException: Database 'C:\PROGRAM FILES\TELERIK\RADCONTROLS FOR ASP.NET AJAX Q1 2011\LIVE DEMOS\APP_DATA\NORTHWIND.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
An attempt to attach an auto-named database for file C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q1 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.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[SqlException (0x80131904): Database 'C:\PROGRAM FILES\TELERIK\RADCONTROLS FOR ASP.NET AJAX Q1 2011\LIVE DEMOS\APP_DATA\NORTHWIND.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
An attempt to attach an auto-named database for file C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q1 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.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050218
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   Telerik.GridExamplesCSharp.Programming.SimpleBinding.DefaultCS.GetDataTable(String query) +200
   Telerik.GridExamplesCSharp.Programming.SimpleBinding.DefaultCS.LoadData() +26
   Telerik.GridExamplesCSharp.Programming.SimpleBinding.DefaultCS.Page_Load(Object sender, EventArgs e) +24
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Adapters.ControlAdapter.OnLoad(EventArgs e) +14
   System.Web.UI.Control.LoadRecursive() +8948986
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
0
milos
Top achievements
Rank 1
answered on 16 Aug 2011, 12:44 PM
Hi Steve,  I also have the same error.  I also uninstalled SQL Server 2005 and installed SQL Server 2008 Express but it didn't resolve it.  I couldn't attach the example MDF database due to the write restrictions (I had the same error message as you).  Did you manage to resolve this?  Good luck! Milos
0
Steve Holdorf
Top achievements
Rank 1
answered on 16 Aug 2011, 01:47 PM
Hi,

When I create apps that use my Telerik controls they work fine with MySQL. What I am doing is use the on-line internet site example demo to help implement my code. What I did notice is that when I installed the MySQL ODBC connection namespace and dll for Windows it added the MyDB conection to my list of databases in VS 2010 along with the Telerik SQL demo databases. In this case the Telerik databases appear red x'ed out when I open the telerik sample demo solution. I removed all database connections in VS and rebuild your solution. When I run in debug the site comes up but anytime data binding occurs. I still get the error and stack trace. Now, what my dba said is that what I need to do is add myself, owner account, to the security database for SQL server. He is writting a script to help me do this today and I will get back with you once I try this and let you know if it works. If it works I will add the script to my next post. If you find a solution before then please let me know.

Thanks,


Steve Holdorf
0
milos
Top achievements
Rank 1
answered on 16 Aug 2011, 02:43 PM
Hi Steve,

I just got it to work.  Although I had set the mdf files as writable I didn't realise that the account I was using didn't have "FULL CONTROL". Right click on the folder and go to the Security Tab.  Check that the account you are using has FULL CONTROL.     I also moved the Telerik databases to a backup folder within SQLServer Express and used a stored procedure to do the attaching.

EXEC sp_attach_db @dbname = N'NorthwindTest',
@filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\Northwind.mdf',
@filename2 = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\Northwind_Log.ldf'

Good luck!
Cheers,
Milos
0
Ziji
Top achievements
Rank 1
answered on 17 Sep 2011, 04:04 PM
I use only SQL SQLExpress 2008 and no SQL Server or SQL Server Dev installed on my Windows 7 laptop.
The account running SQLExpress on my laptop is Network Service.
I had trouble running AJAX Demo as I kept getting above errors for months. I tried many tricks posted here but no luck.
Finally, I tried to grant Full Conctrol to Network Service on 'C:\PROGRAM FILES\TELERIK\RADCONTROLS FOR ASP.NET AJAX Q1 2011\LIVE DEMOS' folder (NOT the App_Data under it !!!) and the Demo works without any database connection error.
The important thing is the folder needs the Full Conctrol permission is LIVE DEMOS, NOT App_Data under it !!!
0
pat
Top achievements
Rank 1
answered on 25 Jan 2012, 11:44 PM
I just copied out of the program files dir into a junk dir and it ran.
0
Lasse
Top achievements
Rank 1
answered on 18 Nov 2014, 10:29 AM

I prepended "Initial Catalog=uniquenamehere;" to the connection string, then it worked.

I also messed with permissions, adding "Everybody" with full permissions to the App_Data folder.

The connection string now is:

<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="Initial Catalog=grid-crud;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Northwind.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>


0
Coen
Top achievements
Rank 2
answered on 03 Sep 2015, 11:53 AM
I am using SQLExpress on my PC and encountered the same issue with attaching the Telerik database in the demo. After trying all of the tricks listed here I decided to open SQL Server management Studio as Administrator. I then could attach the database without error.
Tags
General Discussions
Asked by
Steve Holdorf
Top achievements
Rank 1
Answers by
Steve Holdorf
Top achievements
Rank 1
milos
Top achievements
Rank 1
Ziji
Top achievements
Rank 1
pat
Top achievements
Rank 1
Lasse
Top achievements
Rank 1
Coen
Top achievements
Rank 2
Share this question
or