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

[Solved] Exception in demo

9 Answers 487 Views
Installer and VS Extensions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cody Skidmore
Top achievements
Rank 1
Cody Skidmore asked on 14 May 2010, 02:55 PM
I downloaded the extensions installer and ran it.  The tried out the demo.  When I clicked on the grid demo, the following exception occurred:

Server Error in '/RadControls_AspNetMVC' Application.

Database 'C:\PROGRAM FILES (X86)\TELERIK\EXTENSIONS FOR ASP.NET MVC Q1 2010\EXAMPLES\TELERIK.WEB.MVC.EXAMPLES\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 (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\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.

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: Database 'C:\PROGRAM FILES (X86)\TELERIK\EXTENSIONS FOR ASP.NET MVC Q1 2010\EXAMPLES\TELERIK.WEB.MVC.EXAMPLES\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 (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\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: 

Line 18: <% } %>Line 19: Line 20: <%= Html.Telerik().Grid<OrderDto>(Model)Line 21:         .Name("Grid")Line 22:         .Columns(columns =>

Source File: c:\Program Files (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\Views\Grid\FirstLook.aspx    Line: 20 

Stack Trace: 

[SqlException (0x80131904): Database 'C:\PROGRAM FILES (X86)\TELERIK\EXTENSIONS FOR ASP.NET MVC Q1 2010\EXAMPLES\TELERIK.WEB.MVC.EXAMPLES\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 (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\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) +4849015   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2394   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189   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) +31   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117   System.Data.SqlClient.SqlConnection.Open() +122   System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +44   System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +45   System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +20   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +57   System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +26   Telerik.Web.Mvc.Extensions.QueryableExtensions.Count(IQueryable source) +143   Telerik.Web.Mvc.Extensions.QueryableExtensions.ToGridModel(IQueryable queryable, Int32 page, Int32 pageSize, IList`1 sortDescriptors, IEnumerable`1 filterDescriptors, IEnumerable`1 groupDescriptors) +92   Telerik.Web.Mvc.UI.GridDataProcessor.EnsureDataSourceIsProcessed() +136   Telerik.Web.Mvc.UI.Grid`1.WriteBody(IGridHtmlBuilder`1 builder, IHtmlNode parentTag) +836   Telerik.Web.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer) +1788   Telerik.Web.Mvc.UI.ViewComponentBase.Render() +96   Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render() +22   Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.ToString() +7   System.Web.HttpWriter.Write(Object obj) +22   System.Web.Mvc.SwitchWriter.Write(Object value) +15   System.Web.UI.HtmlTextWriter.Write(Object value) +31   ASP.views_grid_firstlook_aspx.__Render__control2(HtmlTextWriter __w, Control parameterContainer) in c:\Program Files (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\Views\Grid\FirstLook.aspx:20   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Control.Render(HtmlTextWriter writer) +10   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   ASP.views_shared_examples_master.__Render__control3(HtmlTextWriter __w, Control parameterContainer) in c:\Program Files (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\Views\Shared\Examples.Master:16   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Control.Render(HtmlTextWriter writer) +10   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Program Files (x86)\Telerik\Extensions for ASP.NET MVC Q1 2010\Examples\Telerik.Web.Mvc.Examples\Views\Shared\Site.Master:20   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Control.Render(HtmlTextWriter writer) +10   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Control.Render(HtmlTextWriter writer) +10   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Page.Render(HtmlTextWriter writer) +29   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +59   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

My SQL Server version info:
Microsoft SQL Server Management Studio			10.0.2531.0Microsoft Analysis Services Client Tools		10.0.1600.22Microsoft Data Access Components (MDAC)			6.1.7600.16385Microsoft MSXML						3.0 4.0 6.0 Microsoft Internet Explorer				8.0.7600.16385Microsoft .NET Framework				2.0.50727.4927Operating System					6.1.7600

O/S:
Windows 7 Ultimate, x64 

Visual Studio Version:
2008 & 2010

9 Answers, 1 is accepted

Sort by
0
Roman Hammes
Top achievements
Rank 1
answered on 28 Jul 2010, 08:32 PM
I had the same error, just trying to run the ComboBox demo - here is how I resolved it.
0. Go to Administrative Tools, Services, locate your SQLExpress service, right-click properties to discover what the account is that is running SQLExpress (in my case it was Network Service).
1. Open Windows Explorer to your App_Data folder that has the MDF file (given in the error msg), right click on the folder and select Properties.  From that dialog, select the Security tab.  Add... a user (your SQLExpress acct), select it, add FULL CONTROL permissions, click Advanced and select the Child Checkbox, Apply and OK to get out of all dialogs -- now the service can change the MDF file
2. Open SQL Server Management Studio (or whatever means you have of working with databases), expand the Databases folder, right-click on the databases folder, select Attach database, in the dialog, browse for your MDF database, click OK to get out of dialogs (one is a warning about log files).  Your database should have been updated by SQL Express
3. Expand your database, verifiy you can see tables.  If you can, go ahead and right-click on the database, select Tasks... and select Detach; click OK to get out.
*** I repeated above process for all of the Teleik databases, I recommend you do the same ****
4. Just in case, open a CMD prompt as Admin, type IISRESET and press enter.  After that is done, you should be good to go.
 
0
Jon
Top achievements
Rank 1
answered on 18 Nov 2010, 10:54 PM
"2. Open SQL Server Management Studio (or whatever means you have of working with databases), expand the Databases folder, right-click on the databases folder, select Attach database, in the dialog, browse for your MDF database, click OK to get out of dialogs (one is a warning about log files). "

I get this far and get the same error,
Attach database failed for server 'MACHINE\sqlexpress'. (Microsoft.SqlServer.smo)

For help, click: ...

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Database 'C:\WORK\MVC\TRUNK\SOURCE\TELERIK.WEB.MVC.EXAMPLES\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. (Microsoft SQL Server, Error: 3415)

For help, click: ...
0
Jon
Top achievements
Rank 1
answered on 18 Nov 2010, 11:22 PM
Hm. Although SQLExpress is running as Network Service (and full SQL Server is also installed, that is running also as Network Service), after I took ownership of both the .mdf and the .ldf and also added "Service" to the ACL with Full Control the error finally went away.
0
Eder
Top achievements
Rank 1
answered on 07 Dec 2010, 07:19 PM
The same error here.
Change permissions and owner of mdf, and the examples works.
0
Cody Skidmore
Top achievements
Rank 1
answered on 07 Dec 2010, 07:25 PM
>Change permissions and owner of mdf, and the examples works.

Wouldn't that further complicate the problem?  Changing the owner and permissions of Northind could affect access to it by by other apps and SQL Server.
0
Ziji
Top achievements
Rank 1
answered on 17 Sep 2011, 04:01 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
Rod
Top achievements
Rank 1
answered on 07 Jan 2012, 04:21 AM
I just downloaded the RadControls for ASP.NET AJAX, and installed it, and got the same error message.  I tried giving full control to the NETWORK SERVICES account on the Live Demos folder, but I still get the same error message.
0
Erjan Gavalji
Telerik team
answered on 10 Jan 2012, 04:22 PM
Hi Rod,Well, it could be that your system is set up to use another user as the default ASP.NET account. Can you try the following please?

  1. Start Visual Studio and create a new Web Application
  2. Right-click the App_Data folder and choose the "Add New Item..." option
  3. highlight the Data node in the Add New Item dialog that appears and choose SQL Server Database
  4. Right-click the App_Data folder and choose "Open Folder in Windows Explorer"
  5. Right-click the newly created mdf file and select "Properties"
  6. Examine the security settings of the file and apply the same properties to the Northwind database file, shipped by the RadControls installer.
  7. Check the demos again
  8. By the way, just to ensure all the database settings in your machine are correct, you could add some code to access the newly created database to your Web Application's default page and run it.

Let me know if that helped.

Kind regards,
Erjan Gavalji
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Ken Lewis
Top achievements
Rank 1
answered on 05 Apr 2012, 04:09 AM
Erjan,

That solution worked great for me. I discovered I needed to give "Authenticated Users" modify permissions.

Thanks very much.

Ken
Tags
Installer and VS Extensions
Asked by
Cody Skidmore
Top achievements
Rank 1
Answers by
Roman Hammes
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Eder
Top achievements
Rank 1
Cody Skidmore
Top achievements
Rank 1
Ziji
Top achievements
Rank 1
Rod
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Ken Lewis
Top achievements
Rank 1
Share this question
or