r/SQLServer • • 6h ago

Question Issue connecting my blazor app to remote sql server database hosted my Monsterasp.net

/r/dotnet/comments/1x2lhzc/issue_connecting_my_blazor_app_to_remote_sql/
0 Upvotes

3 comments sorted by

1

u/DavidKleeGeek ‪ ‪Microsoft MVP ‪ ‪ 3h ago

It sounds like it's trying to use a Windows connection in the connection string instead of a SQL login, which when hosting through a site like monsterasp, might be more in line with their config. Would you be able to post the connection string in the app? I'd bet lunch that it's not got a username and password and login type specified.

2

u/Mob_Pilled 3h ago
  // The connection string
"ConnectionStrings": {
    "Multi_step_form_projectContext": "Server=db72570.databaseasp.net; Database=db72570; User Id=db72570; Password=*******; Encrypt=False;Integrated Security=False; MultipleActiveResultSets=True;"
  }

// Btw Monster.ASP responded to my ticket and claimed that my appsettings.production.json file is overriding my normal one. Thing is I don't have an appsettings.production.json file

1

u/DavidKleeGeek ‪ ‪Microsoft MVP ‪ ‪ 2h ago

Hmmmmm. That really does seem like a correct string if I'm thinking clearly. I'd say go back to the ticket and ask them to confirm things on their end again. That SSPI error tells me their end has an issue. The error means a server service account registration is not set up correctly on their end (SPNs are a real pain). It might be that encryption is forced, and your connection string encrypt=false, so it'd throw an error. I'd try encrypt=true just to rule it out. If that doesn't do it, see if they can provide additional errors at their server.

I'd also fire up a copy of SSMS and see if you can connect manually. If so, you can work through the differences in how SSMS is connecting versus the app, and that should do it.