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.