An error occurred while connecting to the database configured for ASP. net2.0.

Source: Internet
Author: User
I have been learning ASP. NET over the past few days, but the problem persists during database connection because the following error occurs during Security Configuration:

The following error occurs in the selected data storage area. The reason may be that the server name or credential is invalid or the permissions are insufficient. It may also be caused by the absence of the role manager function. Click the following button to redirect to the page where you can select a new data storage area. The following message may help diagnose the problem: unable to connect to the SQL Server database.

Later, I tried Baidu on the Internet and finally found a solution. Post the solution first:

1. Open the command prompt of Vs, enter aspnet_regsql, and use the default database (aspnetdb ).
2. Open Vs and choose tools> Options> database tools> data connection> SQL server instance name (empty by default) to change it to your server name.
3. For vs, tool --> connect to database --> server name (select the server you just selected), you can select windows or SQL Server for authentication as required, and then select aspnetdb for the database. After the test is OK, copy the Statement data source = server; initial catalog = aspnetdb; user id = SA in the advanced section.
4. Open IIS: default website --> properties --> Asp. net --> edit global configuration --> General --> change the connection string of the connection string manager localsqlserver to: Data Source = server; initial catalog = aspnetdb; user id = sa; password = SA ("; Password = sa" is not copied. it is manually entered. Of course, SA will be replaced with your password ).
5. Go to IIS: default website --> properties --> Asp. Net --> edit global configuration --> authentication --> select "enable role management"

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.