SQLExpress database file auto-creation error
i wanted to build an asp.net website with VS 2010,i have sql server 2008 with using sa login, when i tried to have sign up in website with log in controls, i received this error:
*SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the application's App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:
1- If the application is running on either Windows 7 or Windows Server 2008R2, special configuration steps are necessary to enable automatic creation of the provider database. A开发者_JS百科dditional information is available at: http://go.microsoft.com/fwlink/?LinkId=160102. If the application's App_Data directory does not already exist, the web server account must have read and write access to the application's directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
2- If the application's App_Data directory already exists, the web server account only requires read and write access to the application's App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the application's App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server account's credentials are used when creating the new database.
3- Sql Server Express must be installed on the machine.
4- The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.*
i searched for solving and find out that i must have sql server browser running, i tried to start sql server browser from the sql server configuration manager but i couldn't :-( is starting sql server browser is solve? if yes how? or is there any other solve, how can i solve my problem? i saw the other question in this website but it couldn't help me, thanks
Well first stop using the SA account. That's about the worst security practice out there.
Manually create the database on install (or make the customer do so). If the database doesn't exist look to see if you have rights to create a database and if you do run the CREATE DATABASE statement, then create your objects within the database. This way the database gets created in the correct folders that the owner of the server has specified, which may not be the location that you want to install the database (it's their server not yours, it goes where they want it).
I Got the same error before, it ended up that it is because i was using an old membership class
Membership.GetUser()
This line was the cause of the error. when i removed it everything worked fine.
精彩评论