Asp.net prompts "User 'gnxx-zhfen \ aspnet' Logon Failed ." Problems and Solutions

Source: Internet
Author: User

The data settings in Web. config are as follows:
<Deleetask>
<Add key = "connectionstring" value = "uid = ruobing; Pwd = 123456; server = 127.0.0.1; database = rbwebedu">
</Add>
</Appsettings>

The following error is prompted in IE:
A server error occurs in the "/ruobing" application.

 

User 'gnxx-zhfen \ aspnet' Login Failed.

Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details: system. Data. sqlclient. sqlexception: the user 'gnxx-zhfen \ aspnet' fails to log on.

Source error:

An unhandled exception is generated during the execution of the current Web request. You can use the following exception stack trace information to determine the cause and location of the exception.

Stack trace:

[Sqlexception: the user 'gnxx-zhfen \ aspnet' fails to log on.] System. data. sqlclient. connectionpool. getconnection (Boolean & isintransaction) + 474 system. data. sqlclient. sqlconnectionpoolmanager. getpooledconnection (sqlconnectionstring options, Boolean & isintransaction) + 372 system. data. sqlclient. sqlconnection. open () + 384 free. webclass. page_load (Object sender, eventargs E) in g: \ Asp.net \ rbwebedu \ class_default.aspx.cs: 32 system. web. UI. control. onload (eventargs e) + 67 system. web. UI. control. loadrecursive () + 35 system. web. UI. page. processrequestmain () + 750

Version: Microsoft. NET Framework Version: 1.1.4322.2032; ASP. NET version: 1.1.4322.2032

MATERIALS:
An error occurred while connecting ASP. NET to sqlserver.
Use MSDE in. Net to access the database
Protect. NET web applications in an Intranet environment
The database requested to log on to 'store1 'cannot be opened. Logon Failed. User 'localhost \ aspnet' Login Failed
Completely solve the problem of crystalreports logon Failure
New to. net

The problem persists. Continue tomorrow ~~~~~~~~~~~~~~~~~~~~~~

Here are 3-26 Add:

Indeed, according to the prompts and help settings, This is the help from Microsoft, entitled ----- create from ASP. net to the SQL Server when the trusted data connection received "Login Failed" (Login Failed) error message
The connection is normal and there is no problem, but when I change the database to the target database, an error is prompted. in addition, I can see from the SQL query analyzer that I have not imported the database. I ensure that the database has been imported, because the imported database in the Enterprise Manager is visible, I think the problem may be. I decided to install SQL Server 2000 in the vitrual PC to find out the root cause of the problem.

At, the SQL server was installed on the vitrual PC win2003 server and the database was appended. I checked it in the SQL query analyzer and saw the database I attached, my XP system does not see the attached database in the SQL query analyzer. I initially thought the problem should be in the SQL Server 2000 system and decided to reinstall sqlserver.

After you uninstall SQL Server 2000 at and reinstall it, the problem still exists. The prompt is as follows:
Login Failed for user 'sa '. Reason: not associated with a trusted SQL server connection.

Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details:System. Data. sqlclient. sqlexception: Login Failed for user 'sa '. Reason: not associated with a trusted SQL server connection.

So depressed, I'm all dizzy, hao halo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Continue searching to see why.

At, I was suddenly enlightened. I accidentally saw multiple service instances in the SQL Server service manager. It turned out that there was a problem here. it may be that I have loaded and unloaded SQL Server Multiple times, so that multiple instances are retained in the system. It is no wonder that the previous problems frequently occur. stop the corresponding instance and connect to the instance in the Enterprise Manager. Just follow the previous steps.

Summary:
This is a low-level mistake, but I will not make it again next time.

Related Article

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.