General discussion

Locked

Connection String for SQL SERVER

By svkravi ·
System.Data.SqlClient.SqlException: Login failed for user 'Administrator'. Reason: Not associated with a trusted SQL Server connection.

I m getting this error while establish the connection at the back-end.

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by MadestroITSolutions In reply to Connection String for SQL ...

This error occurs because by default SQL 2000 does not support SQL Server authentication and supports only Windows authentication. To overcome this limitation:

- Enter SQL Enterprise Manager.
- Find your server name in the tree on the left.
- Right mouse click on the server name and select properties.
- Click the Security folder. You should now see the screen below with "Windows Only" set as the default authentication.
- Check SQL Server and Windows as the Authentication.
- Click OK.
- Click Yes to restart SQL.

Good luck!

Collapse -

by ahar In reply to Connection String for SQL ...

If you want to use NT-Authorisation.
First you have to grant (databaseserver-)login for the specific User.
Then enter your database and grant access to the user.
Those two Stored procedures will do the job:

EXEC sp_grantlogin N'<yourdomain>\Administrator';
GO
use <your_database>
GO
EXEC sp_grantdbaccess N'<yourdomain>\Administrator', 'name_in_db';
GO

Collapse -

by LukCAD In reply to Connection String for SQL ...

It is connection string for you collegue:
server=(local)\YOURSERVER;Trusted_Connection=true;database=YOURDATABASE
I glad to hear ASP.NET pro.
Type instead of YOURSERVER and YOURDATABASE names of your sql server and your sql database.

If you know it and it is not help you, then try grant access to your database correctly:

osql -E -S (local)\YOURSERVER -d YOURDATABASE -Q "sp_grantdbaccess 'COMPUTERNAME\ASPNET'"
osql -E -S (local)\YOURSERVER -d YOURDATABASE -Q "sp_addrolemember 'db_owner', 'COMPUTERNAME\ASPNET'"

Collapse -

by amoljpatil In reply to Connection String for SQL ...

Your probs with user ID,PWD,
try with User: sys
Pwd: ""

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums