tags:

views:

45

answers:

2

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'.
+1  A: 

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

Oded
+1  A: 

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.

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