Here is the cenario:
I have an account created on Active Directory named Test.
This account have permission to read the instance of database.
I can access the data inside the domain> through SQL Server Visual Management Studio with Windows Authentication.
Now the problem:
How can I outside> the domain will access this data with a .NET Project Test?
I put this in my app.config:
<connectionStrings>
<add name="CRM" connectionString="Data Source=server; Initial Catalog=catalog; Integrated Security=SSPI; providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<identity impersonate="true" userName="domain\user" password="pass"/>
</system.web>
But i’m still getting this error:
Login failed for user ‘x’. The user is not associated with a trusted SQL Server connection.
The last and not least, yes i do have both SQL and windows authentication mode enabled.
If SQL server is outside the domain then you have to provide the IP and port of server like this
Change in connectionstring
From
To
In the above statement 212.22.231.11 server which has Database hosted in SQL Server. and 1433 is port exposed by SQL Server