Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:28:31+00:00 2026-06-14T02:28:31+00:00

I have a website written in ASP.NET and am trying to deploy it on

  • 0

I have a website written in ASP.NET and am trying to deploy it on Windows 7.

I have successfully deployed the website and it works fine, until I try to access a page which connects to a database. The following error is displayed:

Server Error in ‘/’ Application.


Cannot open database “Bank” requested by the login. The login failed.
Login failed for user ‘IIS APPPOOL\ASP.NET v4.0’.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database “Bank” requested by the login. The login failed.
Login failed for user ‘IIS APPPOOL\ASP.NET v4.0’.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Cannot open database “Bank” requested by the login. The login failed.
Login failed for user ‘IIS APPPOOL\ASP.NET v4.0’.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6351920
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +6366878
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6366793
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +352
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +831
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6368598
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +78
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +2194
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +89
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6372110
System.Data.SqlClient.SqlConnection.Open() +300
SQL_Injection_Vulnerable.LogIn.ImageButton_LogIn_Click(Object sender, ImageClickEventArgs e) in C:\Users\Matthew\Desktop\Thesis\Code\Vulnerability 6 – Information Leakage\Version 16 – Changed Connection Strings\Info_Leakage_Vulnerable\Info_Leakage_Vulnerable\LogIn.aspx.cs:51
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

I used the following procedure to deploy the website in IIS:

  1. Go to Desktop/Code/Info_Leakage_Vulnerable
  2. Copy Info_Leakage_Vulnerable
  3. Go to C:/inetpub/wwwroot
  4. Paste the folder there
  5. Open the Start menu
  6. Type inetmgr
  7. Open HOME-PC/Sites
  8. Right-click on Sites and click on Add Web Site

Site Name = Info_Leakage_Vulnerable

Application Pool = ASP.NET Version 4

Physical Path = Path to folder in C:/inetpub/wwwroot/Info_Leakage_Vulnerable

Port = 1000

  1. Right-click on Info_Leakage_Vulnerable in web sites menu and click on Switch to Content View
  2. Click on HomePage.aspx and click Browse

The website works perfectly in Visual Studio. The problems I am experiencing crop up when running the website from IIS. How can I solve the problem with Database Connectivity please? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:28:32+00:00Added an answer on June 14, 2026 at 2:28 am

    Execute below query in master database. you have to create the login for IIS APPPOOL\ASP.NET v4.0

    CREATE LOGIN [IIS APPPOOL\ASP.NET v4.0] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
    GO
    
    CREATE LOGIN [NT AUTHORITY\NETWORK SERVICE] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
    GO
    

    If still you are facing issue after execution of query then follow these steps

    1. In IIS Choose the ASP.NET v4.0 application pool from the Applications Pools
    2. Right Click on ASP.NET v4.0 –> Choose Advanced Settings...
    3. Under the Process Model section change the Identity value to LocalSystem.
    4. iisreset

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main website app written in ASP.NET's MVC 3. Now, what I
I am trying to make a website in C# ASP.NET. I have been given
I have a website written in ASP.NET. I would like to add subdomains of
I have a website written using ASP.NET. We have a development machine and a
I have a website that returns search results from Twitter, written in C# ASP.NET.
I have an existing website written in ASP.net, I have recently switched to Mac
I have a website written in ASP.NET MVC and I have a parameter set
I have a website written in Classic ASP and ASP.NET, after a few redirects
I have a website that is written in asp.net where the text is resourced
I have recently inherited a website written in Classic ASP, and am currently trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.