0

When I run website in browser, following server error occured -

Server Error in '/FinalHVA' Application.
--------------------------------------------------------------------------------

Cannot open database "HVAdb" requested by the login. The login failed.
Login failed for user 'COMP1\ASPNET'. 

2 Answers 2

1

Looks like the comp1\aspnet user doesn't have permissions to login to the HVAdb database.

Sign up to request clarification or add additional context in comments.

Comments

1

Can you post your web.config file , specifically the Database Connections, it looks like the login credentials being passed to the database is the Machine\ASPNET account

A Standard Connection String will look like this:

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

If you want to use the credentials of the user accessing the web application, you should use:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI; 

Note - you should disable anonymous access on the virtual directory if you would like to use a trusted connection i.e. the second one.

1 Comment

<connectionStrings> <add name="HVAdbConnectionString" connectionString="DataSource=COMP1;Initial Catalog=HVAdb;Integrated Security=True" providerName="System.Data.SqlClient"/> </connectionStrings> This is connection string

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.