SQL connection

Discussion in 'ASP .Net' started by Brad, Mar 24, 2005.

  1. Brad

    Brad Guest

    I am building my first ASP .Net web app using VB .Net and I am getting the
    error:

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

    Where in my program do I set the user or what do I need to configure? I was
    starting to build a windows app and it works fine there. It is just
    whenever I try to do an ASP app I get this message.

    Thanks for the information and any help provided.

    Brad
     
    Brad, Mar 24, 2005
    #1
    1. Advertising

  2. ASP.Net runs under a different user account than executables, which
    generally run under the Local System account. It sounds like your SQL Server
    is configured to use Windows Only authentication, but that may not be the
    case. When using a trusted connection, you must have a domain user account
    that has the necessary permissions. On the other hand, if your SQL Server is
    configured for mixed authentication, you can create a SQL Server account,
    give it th3e necessary permissions, and use the User ID and Password in your
    Connection String.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    What You Seek Is What You Get.

    "Brad" <> wrote in message
    news:...
    >I am building my first ASP .Net web app using VB .Net and I am getting the
    >error:
    >
    > Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    > Server connection.
    >
    > Where in my program do I set the user or what do I need to configure? I
    > was starting to build a windows app and it works fine there. It is just
    > whenever I try to do an ASP app I get this message.
    >
    > Thanks for the information and any help provided.
    >
    > Brad
    >
     
    Kevin Spencer, Mar 24, 2005
    #2
    1. Advertising

  3. Brad

    Brad Guest

    Kevin,

    Thank you for the help. With some tweaking, setting up users and then
    granting then db_owner access, it is now working.

    Brad

    "Kevin Spencer" <> wrote in message
    news:...
    > ASP.Net runs under a different user account than executables, which
    > generally run under the Local System account. It sounds like your SQL
    > Server is configured to use Windows Only authentication, but that may not
    > be the case. When using a trusted connection, you must have a domain user
    > account that has the necessary permissions. On the other hand, if your SQL
    > Server is configured for mixed authentication, you can create a SQL Server
    > account, give it th3e necessary permissions, and use the User ID and
    > Password in your Connection String.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > What You Seek Is What You Get.
    >
    > "Brad" <> wrote in message
    > news:...
    >>I am building my first ASP .Net web app using VB .Net and I am getting the
    >>error:
    >>
    >> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    >> Server connection.
    >>
    >> Where in my program do I set the user or what do I need to configure? I
    >> was starting to build a windows app and it works fine there. It is just
    >> whenever I try to do an ASP app I get this message.
    >>
    >> Thanks for the information and any help provided.
    >>
    >> Brad
    >>

    >
    >
     
    Brad, Mar 25, 2005
    #3
  4. You're very welcome, Brad! :)

    --

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    What You Seek Is What You Get.

    "Brad" <> wrote in message
    news:...
    > Kevin,
    >
    > Thank you for the help. With some tweaking, setting up users and then
    > granting then db_owner access, it is now working.
    >
    > Brad
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    >> ASP.Net runs under a different user account than executables, which
    >> generally run under the Local System account. It sounds like your SQL
    >> Server is configured to use Windows Only authentication, but that may not
    >> be the case. When using a trusted connection, you must have a domain user
    >> account that has the necessary permissions. On the other hand, if your
    >> SQL Server is configured for mixed authentication, you can create a SQL
    >> Server account, give it th3e necessary permissions, and use the User ID
    >> and Password in your Connection String.
    >>
    >> --
    >> HTH,
    >>
    >> Kevin Spencer
    >> Microsoft MVP
    >> .Net Developer
    >> What You Seek Is What You Get.
    >>
    >> "Brad" <> wrote in message
    >> news:...
    >>>I am building my first ASP .Net web app using VB .Net and I am getting
    >>>the error:
    >>>
    >>> Login failed for user '(null)'. Reason: Not associated with a trusted
    >>> SQL Server connection.
    >>>
    >>> Where in my program do I set the user or what do I need to configure? I
    >>> was starting to build a windows app and it works fine there. It is just
    >>> whenever I try to do an ASP app I get this message.
    >>>
    >>> Thanks for the information and any help provided.
    >>>
    >>> Brad
    >>>

    >>
    >>

    >
    >
     
    Kevin Spencer, Mar 25, 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.
Similar Threads
  1. Mythran
    Replies:
    5
    Views:
    4,974
    Mythran
    Oct 5, 2005
  2. Dave Johnson

    Using Connection Class VS Connection Module

    Dave Johnson, Dec 9, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    647
    Dave Johnson
    Dec 11, 2005
  3. Linus Nikander
    Replies:
    5
    Views:
    550
  4. HalcyonWild
    Replies:
    2
    Views:
    963
    HalcyonWild
    Dec 19, 2005
  5. ecoolone
    Replies:
    0
    Views:
    783
    ecoolone
    Jan 3, 2008
Loading...

Share This Page