After the release of the Asp.net website, the solution "database read-only, unable to update data" appears when you use the logon control and registration control.

Source: Internet
Author: User

Problem:
My programming environment is Windows2003 + vs2005 + sqlserver2005express. Sqlserver name: sqlexpress
In the programming environment, you can use the members of vs2005 to provide the aspnetdb database. MDF is used for login and registration, but once it is published to another server (the environment is Windows2003 + dotnet2.0 + sqlserver2005express sqlserver sqname is sqlexpress, the "user name does not exist, cannot log on" and "database aspnetdb. MDF is read-only and data cannot be updated ". When I checked the aspnetdb. MDF in the app_data folder, I found that it does not have the read-only attribute.
I checked a lot of information online and did not find a solution. Then I finally solved the problem through exploration.
The reason for this is that users who can log on to SQL Server (sqlexpress) do not have the permission to read and write the app_data folder. After understanding this cause, we need to first find out what users can log on to SQL Server (sqlexpress). We can use SQL Server Configuration Manager to learn about this. For example:

As you can see, the user of the sqlexpress service on the server is NetworkService. Then, add the NetworkService user to the app_data folder, and set the permission of the NetworkService user to read and write.
If the problem persists after the permission is set, restart the computer. Generally, after restarting the computer, it will be normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.