Showing posts with label dealing. Show all posts
Showing posts with label dealing. Show all posts

Monday, March 26, 2012

Login failed for user (null).

I have an issue dealing with connectivity between the client and Sql Server Services or Sql Authentication. I keep receiving this type of error message:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.


I am sure my connection string is correct within my web config file, I have something like this:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

The reason why I think the connection string is correct is because I have a server where my asp.net application is stored and used, this server is called server1. Server1 is connected to MS-SQL server that is installed and used onserver2.When I run my application fromserver1 everything is perfect, nothing goes wrong, but when I run the application from my client or local machine I get the error message saying not associated with a trusted site.

Now I have the web config set to <identity impersonate="true"> that will allow windows Authentication, and I set the permissions within the database to use NT AUTHORITY \ NETWORK SERVICE as a user, plus my own network credentials are set within user on the database, just so I could troubleshoot the problem. But I still get the error message not associated with a trusted site.

Just to recap my problem, I can see the data when I run the application inServer1,but I can't see the data when I run the application from my local machine.
http://server1/MyApplication.aspx <-- this is an example of the url that I enter on my local machine to acces the application. Plus I have full acces toserver1,and other application are running just fine from this server.

I am using visual studio 2005, but using sql 2000, with the latest service pack for windows XP pro.

thanks,

xyz789

Your connection string is missing your username and password for SqlAuthentication. The reason why it works on server is because its using windows authentication.

It sounds like this is what you intended though. If so, you need to specifiy which user to impersonate by setting the network credentials in your code behind.

|||

I am still a little lost, I thought the <identity impersonate=true> would pick up any user credentials if they were accessing the application on the network. I am not understanding how you check network credentials in the code behind? Do you have an example that you could share with me?

thanks,

xyz789

|||

Hi xyz789,

Generally speaking, you will receive this "Not associated with a trusted SQL Server connection"message when the SQL Serversecurity authentication is set toWindows onlyunder these 3 cases:

1.You are trying to connect to a SQL Server database with a SQL Server login.

2.You are trying to connect to a SQL Server 2000 Desktop Engine (also known as MSDE 2000) database that is installed on a Microsoft Windows 98-based computer by using a trusted SQL Server connection.

3.You are trying to connect to a SQL Server database from a Windows account that does not have sufficient permissions to connect to the server.

|||

Thank you, that solved the problem.

xyz789

Friday, February 24, 2012

Logic on UPDATE query

I am dealing with two tables and I am trying to take one column from a table and match the records with another table and append the data of that column.

I used an update query that looks like this:

UPDATE Acct_table Set Acct_table.Score =
(Select Score_tbl.Score from Score_tbl
Where Acct_table.Acctnb = Score_tbl.Acctnb

This process has been running for over an hour and a half and is building a large log file. I am curious to know if there is a better command that I can use in order to join the tables and then just drop the column from one to the other. Both tables are indexed on Acctnb.

Any insight would truly help.
Thanks!UPDATE A Set A.Score = S.Score
from Acct_table A
JOIN Score_tbl S
ON A.Acctnb = S.Acctnb|||Does anyone else hear an echo?|||Does anyone else hear an echo?No, not a thing. Why?

Yes, I deleted Thrasy's duplicated post

-PatP|||aaaaaaaaaa