deploy asp.net on IIS Locally

Nada Botros 1 Reputation point
2021-02-03T22:28:31.8+00:00

hello i have a question regarding deploying asp net website on IIS locally ... in my website i have connection to my database where GridView1.DataSource = SqlDataSource1;
but it keeps give me this error ...

Cannot open database "Test" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\www.test.com'.

Could you please help me to solve it ..

Thanks

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,573 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce Zhang-MSFT 3,751 Reputation points
    2021-02-04T02:30:35.237+00:00

    Hi @Nada Botros ,

    When a site in IIS connects to a database, you need to make sure that the database Test is a shareable instance.(just a remind)

    1. Open the Test database, select security->logins, right click to New logins....
      63811-2021-02-04-102444.jpg
    2. Login name is IIS APPPOOL\application pool name, windows authentication, check public and sysadmin in server role.
      63763-2021-02-04-102701.jpg
      63764-2021-02-04-102800.jpg
    3. Create a new login name NT AUTHORITY\SYSTEM in the same way.

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Bruce Zhang

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.