✅ .NET8 Connection String Login Failure With Dapper
I have tested my username and password in SQL server management studio and the connection works fine. But when I try using my connection string through my API, my connection string fails.
Previously this did work with .NET 6 but now creating a new project in .NET 8 it breaks. Any advice or fixes are appreciated!
11 Replies
are you getting any error messages or something when establishing the connection?
can you reproduce in a barebones console app?
I will check these now 🙂
Login failed for user 'USER' system.data.SqlClient.SqlExceptions
well there ya go
it doesnt like your login credentials
They work on the SQL server management studio though, they have permissions and are valid login credentials
inspect your string with a hexeditor or something
make sure there are no unexpected invisible characters
Will check now ty!
what database is this btw? MSSQL?
you might need
TrustServerCertificate=true
later versions of SqlClient have changed the default for verifying the servers ssl certOh my god... My colleague is as stupid as it gets
The password was wrong, he said it worked in SQL server management studio. I made him test it and it was wrong. Lord save me
🙂
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Use the /close command to mark a forum thread as answered