Monday, March 26, 2012

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Hi,
I'm new here guys.
I'm developing a web application that's using a separate component to access data from SQL Server 2000. This component uses DAAB of EL June 2005. This data access component resides on a different server from the database server. I would just like to ask if what's the cause of this error. I wonder why it doesn't get the actual user I'm passing?

"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
Our database admin had the database server in mixed mode authentication already.
I don't know if this will help but I'll share the contents of my config files.
web.config contains:
<enterpriselibrary.configurationSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" applicationName="Application" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
<configurationSections>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData" name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="dataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<keyAlgorithmStorageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibrary.configurationSettings>

dataconfiguration.config contains
<?xml version="1.0" encoding="utf-8"?>
<dataConfiguration>
<xmlSerializerSection type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null">
<enterpriseLibrary.databaseSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultInstance="something" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/data">
<databaseTypes>
<databaseType name="Sql Server" type="Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" />
</databaseTypes>
<instances>
<instance name="something" type="Sql Server" connectionString="something" />
</instances>
<connectionStrings>
<connectionString name="something">
<parameters>
<parameter name="data source" value="dbserver" isSensitive="false" />
<parameter name="initial catalog" value="dbname" isSensitive="false" />
<parameter name="Integrated Security" value="SSPI" isSensitive="false" />
<parameter name="password" value="password" isSensitive="true" />
<parameter name="user id" value="userid" isSensitive="false" />
</parameters>
</connectionString>
</connectionStrings>
</enterpriseLibrary.databaseSettings>
</xmlSerializerSection>
</dataConfiguration>

Also, do I need to create an app.config and another dataconfiguration.config files in my data access component?

Hoping for your replies guys. Thanks in advance!

This KB can help you.

http://support.microsoft.com/default.aspx/kb/307002.

No comments:

Post a Comment