Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2008, 03:09 PM
Registered User
 
Join Date: Jul 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Failed to update database

I'm trying to learn ASP.Net from "Beginning ASP.Net 2.0" (VB). I just tried to run the complete sample website on XP Pro IIS. I followed the instructions in the book on how to setup the website, and I think (I'm pretty sure) I got my permissions for the App_Data folder configured correctly. Anyhow, the website (running on localhost) seems to work, but when I click on the shopping cart, or when I go to the shop and click "add to cart" by an item, I get this error:

 
Quote:
quote:Failed to update database "C:\DOCUMENTS AND SETTINGS\ALL USERS\DOCUMENTEN\DEVELOPMENTWEBSITES\WROXUNITED\AP P_DATA\ASPNETDB.MDF" because the database is read-only.
Quote:
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: Failed to update database "C:\DOCUMENTS AND SETTINGS\ALL USERS\DOCUMENTEN\DEVELOPMENTWEBSITES\WROXUNITED\AP P_DATA\ASPNETDB.MDF" because the database is read-only.
Does anybody know how to correct this problem?

Emiel
 
Old July 28th, 2008, 03:22 PM
Registered User
 
Join Date: Jul 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never mind: I found my App_Data folder was read_only. Once I changed that, it worked fine.

Silly me...

 
Old July 28th, 2008, 03:25 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

A few things to check / do:

1. Move the whole web site outside your "My Documents" folder. A good location is C:\Projects or C:\inetpub.

2. Make sure the database file itself (the .mdf) is not read-only.

3. Make sure you configured permissions for the containing *folder*, not just the .mdf file.

4. Make sure you configure the correct account, which is ASPNET on Windows XP.

If that doesn't help, can you please specify what exactly you have configured?

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old July 28th, 2008, 05:07 PM
Registered User
 
Join Date: Jul 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you kindly for your reply. I managed to solve the problem. The permission were configured correctly. Also, the site was not located in the MyDocuments folder (Shared documents folder). It turned out that the App_Data folder was set to "read only", which was why I couldn't update the DB. Once the "read only" was unchecked, it all worked fine. It turned out to be really simple...

Thanks again.

Emiel

 
Old July 29th, 2008, 12:14 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, I saw your reply come in shortly after I posted mine...

Still, you may want to consider the C:\DOCUMENTS AND SETTINGS\ALL USERS\ location; it's not the best place for a web site...

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrox Survey Failed to update database beginer_1 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 April 6th, 2007 01:32 PM
Failed to update database edison7 ASP.NET 2.0 Basics 1 June 22nd, 2006 08:54 AM
Failed to load database information r_ganesh76 Crystal Reports 4 October 7th, 2004 03:04 AM
Database login failed AcidHell2 All Other Wrox Books 0 January 2nd, 2004 02:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.