I have a ASP.NET web application, written by the use of Razor pages and .Net 6. When I was working on my own pc, every thing was OK. Now, I should take the web application to the server computer in a way that many users can use the application.
I published the application into a folder and take that to the server computer.
On the server computer, I use IIS and add a new website which refers to the published folder of application as physical path.
on a client computer, when I go to the website address of the application, the html page and css styles all are OK, but I got the error:
Login failed for user 'ERTEBATCITFOOD$'.
I also provide a piece of my asp.net code for more information. For example, this is what I wrote for connecting to database and making a query:
string connectionString = "Data Source=citfood;Initial Catalog=food;Integrated Security=True";
try
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
string sql1 = "SELECT date, foodName, price FROM [View_1] WHERE userId = @userId " +
"AND date = @thisDate";
using (SqlCommand command = new SqlCommand(sql1, connection))
{
//do something
}
}
}
I don't know what is wrong here...