I had it working before. Only change I did is exporting database by generating script and importing it in server.
Web server: IIS / ASP.NET web app
Connection string:
<add key="ConnectionString" value="Data Source=SERVER;
Initial Catalog=tkl;Persist Security Info=True;
User ID=tkl;Password=PASS; Connection Lifetime=150;
Connect Timeout=150; Pooling=true;Min Pool Size=20;Max Pool Size=500" />
Error:
2020-09-27 05:23:44.6361|ERROR|System.Data.SqlClient.SqlException (0x80131904):
Cannot open database "tkl" requested by the login. The login failed.
Login failed for user 'tkl'.
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
User 'tkl' exists in both TKL database and on SQL Server . I am not sure what is wrong here. probably I need to set some permissions. Any help is appreciated.
Update:
SQL Log:
Login failed for user 'tkl'. Reason: Failed to open the explicitly specified database 'tkl'. [CLIENT: ]
Both windows and SQL authentificaiton are enabled. I can try to post 'tkl' user object permissions as well.
tkl
database user, it likely isn't linked to the correspondingtkl
SQL Login. – AlwaysLearning Sep 27 '20 at 9:34USER
objecttkl
in your database linked to theLOGIN
server objecttkl
? – Larnu Sep 27 '20 at 9:37