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

Discussion in 'ASP .Net Security' started by Rick, Apr 5, 2005.

  1. Rick

    Rick Guest

    I am stumped. Can anyone help?

    I have an ASP.Net Application, trying to connect to SQL Server DB.

    Connection String: Integrated Security=SSPI;Persist Security
    Info=False;Initial Catalog=DB_Name;Data Source=DB_SOURCE;packet size=4096

    IIS Directory Security: Enable Anonymous Access. - The User and Password are
    correct.

    I have checked the database and the Anonymous user has the correct
    permissions.

    Web.config contains <identity impersonate="true" /> and Trust level is set
    to Full

    When Connecting to the DB I get the following Error: "Login failed for user
    '(null)'. Reason: Not associated with a trusted SQL Server connection."

    Thanks,
    Rick
    Rick, Apr 5, 2005
    #1
    1. Advertising

  2. Hello Rick,

    is it a local DB?


    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > I am stumped. Can anyone help?
    >
    > I have an ASP.Net Application, trying to connect to SQL Server DB.
    >
    > Connection String: Integrated Security=SSPI;Persist Security
    > Info=False;Initial Catalog=DB_Name;Data Source=DB_SOURCE;packet
    > size=4096
    >
    > IIS Directory Security: Enable Anonymous Access. - The User and
    > Password are correct.
    >
    > I have checked the database and the Anonymous user has the correct
    > permissions.
    >
    > Web.config contains <identity impersonate="true" /> and Trust level is
    > set to Full
    >
    > When Connecting to the DB I get the following Error: "Login failed for
    > user '(null)'. Reason: Not associated with a trusted SQL Server
    > connection."
    >
    > Thanks,
    > Rick
    Dominick Baier [DevelopMentor], Apr 6, 2005
    #2
    1. Advertising

  3. Rick

    Rick Guest

    It is on a Virtural PC, and Runs under a Sharepoint Portal. The Database
    does reside on the same server.

    "Dominick Baier [DevelopMentor]" <>
    wrote in message news:...
    > Hello Rick,
    >
    > is it a local DB?
    >
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> I am stumped. Can anyone help?
    >>
    >> I have an ASP.Net Application, trying to connect to SQL Server DB.
    >>
    >> Connection String: Integrated Security=SSPI;Persist Security
    >> Info=False;Initial Catalog=DB_Name;Data Source=DB_SOURCE;packet
    >> size=4096
    >>
    >> IIS Directory Security: Enable Anonymous Access. - The User and
    >> Password are correct.
    >>
    >> I have checked the database and the Anonymous user has the correct
    >> permissions.
    >>
    >> Web.config contains <identity impersonate="true" /> and Trust level is
    >> set to Full
    >>
    >> When Connecting to the DB I get the following Error: "Login failed for
    >> user '(null)'. Reason: Not associated with a trusted SQL Server
    >> connection."
    >>
    >> Thanks,
    >> Rick

    >
    >
    >
    Rick, Apr 6, 2005
    #3
  4. Rick

    Rick Guest

    It seems to be a Sharepoint issue. The web site resides under a sharepoint
    portal, If I go directly to the web site everything works fine, if I go to
    the Sharepoint portal and then to the site via a link in Sharepoint. I
    recieve the error, I have also discovered that some of the button click
    events will not fire if going to the site via Sharepoint.


    "Craig Wagner" <> wrote in message
    news:p...
    > "Rick" <test@test> wrote:
    >
    >>I am stumped. Can anyone help?
    >>
    >>I have an ASP.Net Application, trying to connect to SQL Server DB.
    >>
    >>Connection String: Integrated Security=SSPI;Persist Security
    >>Info=False;Initial Catalog=DB_Name;Data Source=DB_SOURCE;packet size=4096
    >>
    >>IIS Directory Security: Enable Anonymous Access. - The User and Password
    >>are
    >>correct.
    >>
    >>I have checked the database and the Anonymous user has the correct
    >>permissions.
    >>
    >>Web.config contains <identity impersonate="true" /> and Trust level is set
    >>to Full
    >>
    >>When Connecting to the DB I get the following Error: "Login failed for
    >>user
    >>'(null)'. Reason: Not associated with a trusted SQL Server connection."

    >
    > I know you said that the Anonymous user had access to the database, but
    > the only
    > time I've consistently seen that error is when the user context under
    > which the
    > app is running is not represented correctly in the database.
    >
    > --
    > Craig Wagner, craig.wagner(at)comcast.net
    > Portland, OR
    >
    > "Don't ban high-performance vehicles, ban low-performance drivers!"
    Rick, Apr 6, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page