r/dotnet • u/Mob_Pilled • Oct 10 '26
Question Issue connecting my blazor app to remote sql server database hosted my Monsterasp.net
Hello everyone. I have completed the multi-step form challenge from Frontend Mentor and attempted to deploy the finished web app using monsterasp.net through visual studio code. I followed all the instructions from a YouTube video to a tee but when I try to actually submit data to the database I get this error:
\Error: Microsoft.Data.SqlClient.SqlException (0x80131904): The target principal name is incorrect. Cannot generate SSPI context.``
I did some further research into it but everything seemingly leads to a dead end for my specific use case. Here is microsoft's documentation on the specific error:
Note: When I built and deployed the app for the first time the connection string was incorrect. I fixed it and published the app again through visual studion. I am not sure whether that is causing some lingering problems.
2
u/polaarbear Oct 10 '26
Where exactly is the database located? Also in MonsterASP I am assuming?
Your SQL Server on your local PC potentially uses Windows Authentication (SSPI integrated security). You can't use integrated security in MonsterASP, you need to use SQL Server authentication instead with a username and password.
1
u/minimalist000 Oct 10 '26
I was able to successfully connect my blazor app to a sql server db on monstersasp.net with no issues. Can you show us a redacted version of your db connection string on the environment variables?
1
u/AutoModerator Oct 10 '26
Thanks for your post Mob_Pilled. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/flying_slow_low Oct 15 '26
Can you connect from SQL Server Management Studio using your conn string?
1
u/[deleted] Oct 10 '26
[removed] — view removed comment
1
u/[deleted] Oct 10 '26
[removed] — view removed comment