Hello all,
I have been trying to figure out why I am logged as [ServerName]/Guest to the SQL server. I am trying to connect to the db and do some actions but due to being logged as Guest, it is avoiding me to do the proper actions.
My connection string is used to be:
CONNECTION_STRING = "Server=SERVER2\\SQLEXPRESS; Database=RMA_DB; Trusted_Connection=True;"
when I use this I am logged as Guest but when I add a valid user name and a password I am not logged in as Guest anymore. I am logged as a the username that I provided.
for that my connection string is;
CONNECTION_STRING = "Server=SERVER2\\SQLEXPRESS; User Id=[userid]; Password=[password]; Database=RMA_DB; Trusted_Connection=False;"
As far as i know the main reason behind this is;
Enabling impersonation causes ASP.NET to make the request to the SQL Server as the name of the user currently running. Using impersonation works if anyone who hits the site has Windows credentials. While I am testing, that works but when I am going to create a site that people might get to via the Internet, though, then impersonation won't work, because users won't have credentials. In that case, I shouldn't use impersonation.
In another web application that I previously used, the connection string without the username and the password is working perfectly fine tho. What I dont understand why this app can able to connect without the username and password in the server? What I am missing can someone explain?