.NET Framework 3.5For discussion of the Microsoft .NET Framework 3.5.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the .NET Framework 3.5 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
What type of SQL Server are you using? (e.g. 2000, 2005(full/express) etc? And how does your connection string look like? Do you have your database in App_Data?
I start to sound like a broken record, but please provide this kind of information with your post. IIS5 helps, but as you can see from the error message, a lot of other stuff is relevant as well...
I'm using SQL Server 2005 Express edition. The database is inside the App_data folder. Everything works great under the Visual web developer.
I figured that the sql server state was stopped now so, i started it and now I have this error:
Server Error in '/FrameworksDB_Updatable' Application.
--------------------------------------------------------------------------------
Failed to update database "C:\FRAMEWORKSDB_UPDATABLE\APP_DATA\FRAMEWORK_DB.M DF" because the database is read-only.
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:\FRAMEWORKSDB_UPDATABLE\APP_DATA\FRAMEWORK_DB.M DF" because the database is read-only.
So what's happening now is that the default page opens and then when i try to use one of the functionalities in my menu that works with the database, it gives the above error.
I'm sorry that I don't provide everything you need but really i don't know a lot here so I'm trying to respond to your questions as much as I can.
You need to grant permissions for the ASP.NET account to the App_Data folder. This way, that account can access the MDF database and write to it. The account you need to configure is probably called Network Service or ASPNET, depending on your version of Windows.
Thanks Imar.. at last it's working, it seems that it was only the permissions of the ASPNet user that needed to be changed.. Thank you so much.. I'm ready now to upload it to the production server hoping that nothing will go wrong.