There are and remote sql server and local C# app.
I can connect to DB via ssms The command '"C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe" -S server -U user -P password ' performs great
But in code
my ConnectionString:
connectionString="Data Source=Server;Initial Catalog=DB;integrated security=false;User ID=user; Password=password;" providerName="System.Data.SqlClient"
when I try to open connction
using (var conn = new SqlConnection(_connectionString))
{
conn.Open();
I get an error "Cannot open database "DB" requested by the login. The login failed. Login failed for user 'user'"
How can it possible? I have managed to connect by using the same user&pass to this server via ssms!! What other permission should have sql-user to connect to DB via C#-application?
P.S The point is (99.9%) on DB server side. And some permissions on it. Because with another remote Server everything works ok.