none
'NT AUTHORITY\ANONYMOUS LOGON' RRS feed

  • Question

  • I've created a form in Visual Studio and have the following connection string to connect to a SQL db SQL2000.

     

    <add name="testingConnectionString4" connectionString="Data Source="SQLIpAddress;Initial Catalog=dbname;Integrated Security=SSPI;User Id=SQLOwnerID;Password=SQLOwnerPwd"

    providerName="System.Data.SqlClient" />

     

    When I run the form locally from my computer, the form works fine.  However, when I published to the web server I receive the following error.

     

    The sql server is not part of the domain it is a member server and it is on a different machine then the web server.  How do I fix this?

     

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     

     

    System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

    at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)

    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)

    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)

    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)

    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)

    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)

    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

    at System.Data.SqlClient.SqlConnection.Open()

    at System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation)

    at System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values)

    at System.Web.UI.WebControls.SqlDataSource.Insert()

    at Default11.Submit1_ServerClick(Object sender, EventArgs e)

     

    Monday, June 9, 2008 3:34 PM

Answers

  • You are having a double hop problem the simple way to fix it is to put the Asp.net account or Network Service account if Win2003 in the server running SQL Server on the Server level and in SQL Server.   In SQL Server 2000 you will find that place under management then security to add the account for Asp.net.

     

     

     

    Monday, June 9, 2008 4:21 PM
  • Change this:

     

     

    <add name="testingConnectionString4" connectionString="Data Source="SQLIpAddress;Initial Catalog=dbname;Integrated Security=SSPI;User Id=SQLOwnerID;Password=SQLOwnerPwd"

    providerName="System.Data.SqlClient" />

     

    To this:

     

    <add name="testingConnectionString4" connectionString="Data Source="SQLIpAddress;Initial Catalog=dbname;User Id=SQLOwnerID;Password=SQLOwnerPwd"

    providerName="System.Data.SqlClient" />

     

    I removed -> Integrated Security=SSPI;

     

    You can either specify -> Integrated Security=SSPI;

    Or -> User Id=SQLOwnerID;Password=SQLOwnerPwd

     

    If you specify BOTH, then Integrated Security=SSPI; wins.

    Monday, June 9, 2008 11:29 PM

All replies

  • You are having a double hop problem the simple way to fix it is to put the Asp.net account or Network Service account if Win2003 in the server running SQL Server on the Server level and in SQL Server.   In SQL Server 2000 you will find that place under management then security to add the account for Asp.net.

     

     

     

    Monday, June 9, 2008 4:21 PM
  • Change this:

     

     

    <add name="testingConnectionString4" connectionString="Data Source="SQLIpAddress;Initial Catalog=dbname;Integrated Security=SSPI;User Id=SQLOwnerID;Password=SQLOwnerPwd"

    providerName="System.Data.SqlClient" />

     

    To this:

     

    <add name="testingConnectionString4" connectionString="Data Source="SQLIpAddress;Initial Catalog=dbname;User Id=SQLOwnerID;Password=SQLOwnerPwd"

    providerName="System.Data.SqlClient" />

     

    I removed -> Integrated Security=SSPI;

     

    You can either specify -> Integrated Security=SSPI;

    Or -> User Id=SQLOwnerID;Password=SQLOwnerPwd

     

    If you specify BOTH, then Integrated Security=SSPI; wins.

    Monday, June 9, 2008 11:29 PM