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

  • SEARCH
  • Home
  • 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 7733261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:56:32+00:00 2026-06-01T06:56:32+00:00

This is my code : DataClassesDataContext data = new DataClassesDataContext(); var hey = from

  • 0

This is my code :

DataClassesDataContext data = new DataClassesDataContext();
var hey = from p in data.Provas
          select p;
Response.Write(hey.First().title_it);

if I open this playing start to Visual Studio, it opens http://localhost:51180/Website1/ and I get the value taken from DB.

But, if I open the website with http://localhost:8080/ (which usually I open with this) I get :

System.Data.SqlClient.SqlException: Cannot open database "Website1" requested by the login. The login failed.

Login failed for user ‘IIS APPPOOL\Website1’.

How can I should settings? IIS problem?

  • 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-01T06:56:33+00:00Added an answer on June 1, 2026 at 6:56 am

    As @usr pointed out the answer is in front of you.

    When you run the app in debug mode form Visual Studio the user connecting to the database is the user logged into the PC and running Visual Studio – the odd are that this user (you!) is an administrator and has administrator rights with SQL Server (I’m assuming a local instance).

    When you run the app via the local installation of IIS (which it is reasonable to assume is the full version, not express) then, unless you change the app pool for the application, it will be running as a local system user (right now I forget which one, you can go look at the app pool to see) and by default that user will not have access to the databases in SQL Server.

    To fix this you need to do one of two things either:
    a) Change the user in the app pool to one that has rights to the database in SQL Server (if you want good practice then you should define an explicit user)
    b) Grant the appropriate rights to the appropriate system account to access the database

    (Note that in both cases you’re going to need to add the user to SQL Server using Management Studio or equivalent)

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

Sidebar

Related Questions

This code snippet is from C# in Depth static bool AreReferencesEqual<T>(T first, T second)
This Code: Something = new Guid() is returning: 00000000-0000-0000-0000-000000000000 all the time and I
This code attempts to dynamically switch the class of the StateContainer div from StateOne
this code is correct?? String note = text.txt; FileWriter file = new FileWriter(note); Scanner
This code: $(#permalink a).click(function(id){ var id = this.getAttribute('href'); $(#newPostContent).load(id, function() { $(#removeTrigger).click(function() { $(#removeThis).hideToggle();
How come this line of code mine shows an error of var searchUser =
This code is from Prototype.js . I've looked at probably 20 different tutorials, and
this code always returns 0 in PHP 5.2.5 for microseconds: <?php $dt = new
This code does not seem to compile, I just need to write something to
I wrote this code: string Dcname = DataClasses1DataContext; string TableName = Order; var dc

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.