Database 'C:\INETPUB\WWWROOT\HOURSREPORTING\APP_DATA\ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.

I have a website that runs on this computer through IIS. It was working fine until I went into it and added a textbox. Now it gives me this:

Server Error in '/' Application.

Database 'C:\INETPUB\WWWROOT\HOURSREPORTING\APP_DATA\ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

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:\INETPUB\WWWROOT\HOURSREPORTING\APP_DATA\ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Database 'C:\INETPUB\WWWROOT\HOURSREPORTING\APP_DATA\ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
   System.Web.UI.WebControls.Login.AttemptLogin() +105
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

 

I changed everything back to how I had it but it is STILL doing this... I have been working for an hour to fixit but I get nothing.

 

It has something to do with the sql database inside the website, it is using integrated security or something (im kind of new to this)

I would like to change it so it has a password and username so it would fix this problem but I don't know how to do that. I have SQL manager express on here but still I can't figure out a way to fix this issue

 

does ANYONE have any ideas?

0
sabrick
5/28/2008 7:36:12 PM
asp.net.security 27051 articles. 1 followers. Follow

2 Replies
2014 Views

Similar Articles

[PageSpeed] 9

AHHHHHH!!!!

 I just remove the website from IIS and restart the computer and put it back into IIS and it works.

Why is this happening? What am I doing to make this happen constantly?

0
sabrick
5/28/2008 7:57:08 PM

this is a connection string issue , you have 2 solutions ,

the first one is to use a user name and password in the connection string instead of using integrated connection , for this you need to add a user to your datbase through sql  managemnt express ,

then in web.config file , you need to write this inside connections section ( you need to use the actual username/ password for the user that you added to your database )

    <connectionStrings>
      <remove name="LocalSqlServer"/>
      <add name="LocalSqlServer" connectionString="Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"/>
    </connectionStrings>
The second solution is to add the network service account to your database login accounts and use integrated security , 
Also , you need to make sure that the Network service account( or aspnet account in XP)  has a write permission on App_Data folder.
 

Regards,

Anas Ghanem.


Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

0
anas
5/28/2008 8:21:52 PM
Reply:

Similar Artilces:

'C:\INETPUB\WWWROOT\APP_DATA\ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
I have developed an app with sql server express 2005 and IIS and when I try to run it on another computer I get the following error message: ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.Cannot open user default database. Login failed.Login failed for user 'IBM\ASPNET'. Help would be much appreciated. Thanks Darren ACLs on the folders, permissions, check to see if SQL Express is installed, etc. JeffPlease: Don't forget to click "Mark as Answer" on the post that helped you. That ...

Any solution for error message "Could not attach file 'App_Data\Database.mdf' as database 'Database'."?
Hello, I'm trying to connect to Database.mdf from an asp.net file and I get the following error message:    Could not attach file 'App_Data\Database.mdf' as database 'Database'.   CREATE DATABASE permission denied in database 'master' The connection string I use is:    Provider=SQLNCLI;Server=localhost\SQLExpress;AttachDbFilename=App_Data\Database.mdf;Database=Database;Trusted_Connection=Yes Thanks!!!Ornit Hi, that's because your account doesn't have enough priviledge on the database server.Use Sqlserver management studio to add the necesso...

Failed to update database "C:\INETPUB\WWWROOT\APP_DATA\ASPNETDB.MDF" because the database is read-only.
I'm new to ASP.NET (I normally work with Windows Forms) and have installed the Club Website Starter Kit. I created an Administrators role and a user called "admin". When I run the project locally, everything works as it should - I can log in as admin and I can create new users. I then copied the site to localhost (C:\Inetpub\wwwroot), but when I run the site from localhost, I can't log in (as admin or any other user); instead I get a message that says, "Your login attempt was not successful. Please try again." Also, I can't create a new user. When I try, I get the following error: Server ...

Failed to update database "C:\INETPUB\WWWROOT\LOGIN\APP_DATA\ASPNETDB.MDF" because the database is read-only.
This is the Error i am getting when i user the login controls in ASP.NET 2.0When i run the same on the visual studios inbuilt web server its run perfectly fine.but when i transfer the files to IIS wwwroot any page which has to do with the LOGIN\APP_DATA\ASPNETDB.MDF gives a read-only errorI have checked the permissions and properties and it has all the access on IISI have sql server 2000 and i am also using the SQL server 2005 CTPwhat could be the issue??THANKS I+N ADVANCE A member of the ASP.NET Team posted the solution here: http://forums.asp.net/906004/ShowPost.aspx Darrell Norton, MV...

System.Data.SqlClient.SqlException: Failed to update database "C:\INETPUB\WWWROOT\APP_DATA\ASPNETDB.MDF" because the database is read-only
Hello, I'm doing some tests with asp.net and all works fine in the development environment (Visual Studio 2005), but as soon i publish my WebSite to my local server the errors come in hundreds. My first problem is about security: i have a login.aspx page with a recoverypassword control. In Visual Studio i can log to the site, put my login name and password and it all goes fine. If i try the recoverypassword control it works fine to: i put my login name, answer the question, and in a few seconds i receive an email with my password. Then i publish the site, i use the 'Publish We...

Failed to update database "C:\INETPUB\WWWROOT\APP_DATA\TIMETRACKER.MDF" because the database is read-only.
This site is ready to run! No changes are needed. Press CTRL+F5 to run the site.Its not realy. It's definitely clear that this is NOT a 'ready to run' app!It cannot run scripts for a standard install on SQL 2005, but rather depends on SQL Express!?  Very tuff job trying to get this set up. And even harder to find answers to config questions.So far, I have installed/uninstalled the data bases and app 2x, the results are the same on my XP Pro box.  I keep getting an error message from DAL/DataAccess telling me it can't find the 'Issue_Tracker database connection string!! I am cluel...

Failed to update database "C:\INETPUB\WWWROOT\MH\APP_DATA\Abc.MDF" because the database is read-only.
 I have created one web site having update and editing enabled but while updating i mgetting this error pls help me out this works in vs 2008 means at localhost and in IIS it gives  error only while updating and inserting data  you need to give the mdf file at c:\inetpub\wwwroot\mh\app_data\abc.mdf read/write permission to the aspnet user, you can do this by navigating to that location and then right clicking and selecting properties. From there goto security and modify the permissions.   ~P I already tried this thing but unfortunately it's not worki...

"C:\INETPUB\WWWROOT\SLEPCHA\APP_DATA\ASPNETDB.MDF" because the database is read-only.
i have created a appl and deployed it in IIS .   When i login from the login page i get a error :Server Error in '/slepcha' Application.-------------------------------------------------------------------------------- Failed to update database "C:\INETPUB\WWWROOT\SLEPCHA\APP_DATA\ASPNETDB.MDF" 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...

The Microsoft Jet database engine cannot open the file 'C:\Path\Database.mdb'.
Hello. I keep getting the error, "The Microsoft Jet database engine cannot open the file 'C:\Path\Database.mdb'. It is already opened exclusively by another user, or you need permission to view its data." I Googled the error and applied every fix that was recommended, but to no avail. From the beginning, I am using ISS 5.0. I have the latest version of MDAC with Service Pack 3 and I have JET 4.0 with Service Pack 8. I am using Web Matrix Version 0.6, Framework 1.1.4322.573. I used the SELECT Code wizard which generated this code below: Function GetCustomers() As System.Dat...

Unable to open Web project 'GEC'. The file path 'C:\Inetpub\wwwroot\GEC\test' does not correspond to the URL 'http://Localhost:/GEC'.
I'm a VS 2005 guy so I need some reasoning here as to why I can't get this .NET 1.1 web project to open in VS 2003.After clicking the web project from C:\inetpub\wwwroot\GEC\GEC.vbproj, I get the following error in VS 2005: Unable to open Web project 'GEC'. The file path 'C:\Inetpub\wwwroot\GEC\test' does not correspond to the URL 'http://Localhost:/GEC'. The two need to map to the same server location. HTTP Error 404: Object Not FoundWhen is Microsoft going to get rid of VB.NET! Hi dba123,This may be a little late now, I figure 5 days have past, but ju...

Missing File? Could not find file 'C:\Inetpub\wwwroot\SiteUrls.config'. DNN 4.0
Hi all.....just downloaded 4.0 and I got the above error message when I tried to run the install. Could not find file 'C:\Inetpub\wwwroot\SiteUrls.config'. Can some explain what DNN is looking for or offer suggestions?  Is it something that I need to create?  I am running DNN on W2K sever and ASP.NET 2.0Shadow I ran into this with the source version on my development system.  After a rebuild of the solution in VS 2005, everything appears to work correctly. We just had a discussion in the core team chat about this - I had this issue on weekend in a build - there ha...

Unable to create web project 'WebApplication1'. The file path 'c:\inetpub\wwwroot\WebApplication1' does not correspond to the URL 'http://localhost/WebApplication1'. The two need to map to the same se
Hi, I am using a Windows 2003 server machine with VS2003 , SQl Server2000 and sharepoint portal installed. When i try to create a new ASP.NET application I am getting this error : The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/WebApplication1' cannot be opened with the path 'c:\inetpub\wwwroot\WebApplication1'. The error returned was: Unable to create web project 'WebApplication1'. The file path 'c:\inetpub\wwwroot\WebApplication1' does not correspond to the URL 'http://localhost/WebApplication1'. The two need to map to the...

Failed to update database "C:\LOGIN1\APP_DATA\ASPNETDB.MDF" because the database is read-only.
Hi Guys I'm able to run my login in visual web developer's debug mode but I'm not able the create a user or login in as a remote user. I'm using visual web developer Membership and roles, Window XP Pro, IIS 5.1. Below is the error. I have read about this error in this forum but i can't get it working. Hope anyone is kind enough to give me a clear step by step on solving this problem. Thanks Sounds like a permissions problem, try this link for a couple of fix's http://www.faqes.com/answer.aspx?q=&p=24 Burl Hi Burl I have just solve thi...

ASPNETDB.MDF cannot be upgraded because it is read-only or has read-only files
I upgraded to Beta 2 on my development box and then upgraded to Beta 2 on another machine and copied a website to the new machine.  On the new machine, I'm seeing the following error in the Event log and occassionaly on the website itself.  This shows up as an informational (not an error).  I did check and some of the files were read-only (CVS system), but after removing the read-only flag, I still see the logsHow can I fix this?  How do I "run recovery"?  Thanks! Event Type: InformationEvent Source: ASP.NET 2.0.50215.0Event Category: Web Event Event ...

Web resources about - Database 'C:\INETPUB\WWWROOT\HOURSREPORTING\APP_DATA\ASPNETDB.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery. - asp.net.security

Resident Duty Hours: Enhancing Sleep, Supervision, and Safety
Medical residents in hospitals are often required to be on duty for long hours. In 2003 the organization overseeing graduate medical education ...

Resources last updated: 1/15/2016 3:32:15 PM