SQL Connection problem

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default SQL Connection problem

    Hi all,
    I tried to connect a database(SQL) by both VS 2003 interface tools and
    normal typing.

    When I make the connection in subdirectory project it doesn't work and gives
    an
    error like this;

    Server Error in '/WebApplication1' Application.
    ----------------------------------------------------
    Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    Nevertheless, when I use the same .aspx page in normal web site (without any
    sub directory) it works without any error.

    I have been using Windows 2000 and it was both working but when I installed
    Windows 2003 Enterprise Edition, it started to give that error(below). So,
    most probably this error acquires because of Windows 2003 settings is there
    anyone who knows how to solve this problem?

    Kind Regards,
    Arda Coskun




    Arda Guest

  2. Similar Questions and Discussions

    1. Connection key problem
      I can connect to my website if I manually set up the connection in Contribute. When I send a connection key we get an error message that the...
    2. ASP.NET SQL Connection Problem
      When I select the SQL Server Connection (in a new ASP.NET page) I get up the Connection strings box. I enter the correct info but when I press Test...
    3. 3.1 connection problem
      I have an HP Laptyop with XP Pro. DWMX2004 and Contribute 2 work fine, but 3.1 refuses to connect to anything, regardless of whether it in my...
    4. New Connection Key problem
      I know, I know, look at the threads. Hey, I've been using Contribute to manage Content Managers for nearly two years now and we've managed to get...
    5. "Contribute cannot verify your connection information"- Every other problem ruled out, but still no connection
      Hi, first, please allow me to give you the background info Client OS - Windows 2000/XP Pro Version - Contribute 2.01 - I installed the patch from...
  3. #2

    Default Re: SQL Connection problem

    Arda,
    By default, the ASP.NET worker process on a Windows Server 2003 (IIS6)
    machine uses the local "NT AUTHORITY\NETWORK SERVICE" user
    account. And on Windows 2000 / XP (IIS 5.x), it uses the local ASPNET .
    user account. Also, ASP.NET has impersonnation turned off by default.

    Hence, in this configuration, if you want your web page to access a Sql Server
    database, you'll need to give database access permissions to the corresponding
    local user account, depending on which IIS version you are using.

    Here is a summary for a machine called "CARLP7" on IIS 5.x,
    with Authentication mode="Windows" in web.config

    - If Identity impersonate="false" and IIS Anon Access enabled
    => WindowsIdentity.GetCurrent().Name = CARLP7\ASPNET

    - If Identity impersonate="false" and IIS NTLM enabled
    => WindowsIdentity.GetCurrent().Name = CARLP7\ASPNET

    - If Identity impersonate="true" and IIS Anon Access enabled
    => WindowsIdentity.GetCurrent().Name = CARLP7\IUSR_CARLP7

    - If Identity impersonate="true" and IIS NTLM enabled
    => WindowsIdentity.GetCurrent().Name = CARLP7\Administrator (logged on user)


    Here is a summary for a machine called "CARLP7" on IIS 6.0,
    with Authentication mode="Windows" in web.config

    - If Identity impersonate="false" and IIS Anon Access enabled
    => WindowsIdentity.GetCurrent().Name = NT AUTHORITY\NETWORK SERVICE

    - If Identity impersonate="false" and IIS NTLM enabled
    => WindowsIdentity.GetCurrent().Name = NT AUTHORITY\NETWORK SERVICE

    - If Identity impersonate="true" and IIS Anon Access enabled
    => WindowsIdentity.GetCurrent().Name = CARLP7\IUSR_CARLP7

    - If Identity impersonate="true" and IIS NTLM enabled
    => WindowsIdentity.GetCurrent().Name = CARLP7\Administrator (logged on user)

    --

    Thanks,
    Carl Prothman
    Microsoft ASP.NET MVP
    [url]http://www.able-consulting.com[/url]


    "Arda" <sac@simetriyazilim.com> wrote in message news:#f9q3kFVDHA.2364@TK2MSFTNGP10.phx.gbl...
    > Hi all,
    > I tried to connect a database(SQL) by both VS 2003 interface tools and
    > normal typing.
    >
    > When I make the connection in subdirectory project it doesn't work and gives
    > an
    > error like this;
    >
    > Server Error in '/WebApplication1' Application.
    > ----------------------------------------------------
    > Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
    >
    > Nevertheless, when I use the same .aspx page in normal web site (without any
    > sub directory) it works without any error.
    >
    > I have been using Windows 2000 and it was both working but when I installed
    > Windows 2003 Enterprise Edition, it started to give that error(below). So,
    > most probably this error acquires because of Windows 2003 settings is there
    > anyone who knows how to solve this problem?
    >
    > Kind Regards,
    > Arda Coskun
    >
    >
    >
    >

    Carl Prothman [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139