Reputation: 1047
I am working on .net core application, which will connect to database to fetch records.
here is the connection string:
Server=NEWGGHEG1RDMDBI.id.Test.test1.COM\FF1,3133;Database=T1;Integrated Security=False;User Id=AMR\s_testuser;Password=test@123;Persist Security Info=True;
when i try connecting to database using this connectionstring, it says Login Failed to user 'AMR\s_testuser'.
Username and password which i am passing are correct.
I tried many answers, but nothing worked. Please help me on this. Thank you
Upvotes: 0
Views: 1063
Reputation: 2992
Have you verified that the Domain Account has access to the database server? There should be a corresponding Login on the server for the domain User/Group attempting to connection. In addition to this, there would need to be a database user mapped to the login and granted the appropriate permissions/roles on the target database (T1)
Give the following connection string a try:
Server=NEWGGHEG1RDMDBI.id.Test.test1.COM\FF1,3133;Database=T1;Integrated Security=True
Upvotes: 0
Reputation: 1864
Based on your comments and your error message, you are using the wrong authentication. If you created the user inside SQL Server then you should be using standard security. If you are using a domain account, which you show in your connection string, you need to be using trusted connection.
Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password=myPassword;
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
Notice that trusted does not pass any credentials where as standard does.
https://www.connectionstrings.com/sql-server/
Upvotes: 0