I have a web app that runs on a Windows Server within IIS. This app is using Windows Authentication. I am trying to use the C# SqlConnection, as I need to call a stored procedure with a TVP, but I am getting a login issue.
The error is
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON
but my HttpContext.Current.Identity is my Windows account.
using (var conn = new SqlConnection(connection))
{
conn.Open();
}
This works if I use Entity Framework:
using (var context = new DatabaseEntities())
{
...
}
I was curious why in the standard c# SqlConnection, it doesn't use the Windows identity, but in the Entity Framework connection, it does. Any help?