October 11, 2021 at 4:36 pm
I'm working on an ASP.NET MVC app, following along a tutorial in CODE magazine. I'm doing this tutorial at home, with SQL Server 2019 Developer Edition installed on a Windows 10 Professional PC, named RazorCrest. I'm doing development on different Windows 10 Professional machine. Using the connection string from the article's tutorial, I've changed it to use RazorCrest, so it looks like this:
"Server=RazorCrest;Database=PaulsAutoParts;Trusted_Connection=True;MultipleActiveResultSets=true"
I'm doing this in a home environment, just peer-to-peer network.
When I tried to just verify the connection from the app, which just does a SELECT from a table with only a few records in it. However, it failed with this error:
Microsoft.Data.SqlClient.SqlException
HResult=0x80131904
Message=Failed to generate SSPI context.
Source=Core Microsoft SqlClient Data Provider
I've done this before with a different app, but in that case I used SQL Authentication instead of Windows authentication. In this case, the author of the tutorial is used Windows authentication. I had hoped I could use that, giving my Microsoft credentials when the attempt to open the connection came about, but as you can see by the error that didn't happen. I'm wondering, is it possible, given my peer-to-peer network, to make this work with Windows authentication? Or must I use SQL Authentication?
Rod
October 11, 2021 at 7:56 pm
Without a domain - you need to have local accounts on both systems with exactly the same username and password. And even then - you can end up having issues connecting.
Just change it to a SQL account - that shouldn't cause any issues with the tutorial.
Also note: unless specifically required for your application, using MARS can cause performance and should not be used. I don't know anything about this tutorial but my guess is that you really don't need multiple active resultsets.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
October 13, 2021 at 12:16 am
I've been working on another tutorial for writing APIs using ASP.NET Core. That works, but in that case I used SQL Authentication. There's two reasons why I was going with Windows authentication:
Rod
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply