Newbie Question - "trusted SQL Server connection"

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

  1. #1

    Default Newbie Question - "trusted SQL Server connection"

    I am just getting started with ASP.Net. I am attempting to place a dateGrid
    on a page and I have done all the things I would do in a Windows
    application:

    - drag a connection to the form
    - preview the data
    - generate a data set

    When I run the app I get:

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

    string strConnectionString = "packet size=4096;user
    id=MyUserName;password=MyPassword;integrated security=SSPI;data
    source=MAGRATHEA;persist security info=False;initial catalog=Tracker";
    cn.ConnectionString = strConnectionString;
    da.Fill(ds.tblInfo);

    It fails on the .fill.

    The above works perfectly in a WinApp but apparently the user name is not
    picked up as I would have thought. There is obviously some additional
    voodoo I need to do on the web side.


    Any help is greatly appreciated.


    Greg Smith Guest

  2. Similar Questions and Discussions

    1. Newbie question: How can I create a "tiled" background?
      How can I create a "tiled" background from a GIF image in FlashMX? I have searched and searched on Google, but haven't found the answer. I would...
    2. "Connection closed by remote server" error in Opera
      I have a web site (www.on-the-matrix.com) that displays photos in a "slide show" format on ASPX pages that run in an inline frame on an ASP page (or...
    3. Newbie question: What is "SQL*Net roundtrips to/from client" in the utlestat report
      yanivv@savantis.com (Yaniv) wrote in message news:<2a8fcd9.0307170814.36fc2cff@posting.google.com>... upload your output to OraPerf...
    4. "A connection to the server could not be established" - Trying to open existing project
      I came in today and tried to edit a project that I was working with, locally, at the tail end of last week. This web project was created, hosted, ...
    5. Newbie question about &quot;alter database create datafile..&quot;
      oracle2000 wrote: Did you check the details of the error message? The explanation is pretty straightforward: $ oerr ora 1178 01178, 00000,...
  3. #2

    Default Re: Newbie Question - "trusted SQL Server connection"

    Your connection string contains the text "integrated security=SSPI", which
    indicates that you want to use the Security Support Provider Interface. In
    other words, you want to use Windows authentication. This will work fine on
    your Windows applications, as long as the user who launched the application
    has permissions to the database you are trying to connect to. However, the
    account MACHINE\ASPNET (which is the process identity that ASP.NET runs
    under by default) does not have the ability to authenticate to another
    server (unless you either control the password or else get very lucky),
    which is the windows authentication information you are passing. Try
    removing this from your connection string if your intention is to use SQL
    authentication.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows XP
    Windows XP Associate Expert
    --
    "Greg Smith" <gjs@umn.edu> wrote in message
    news:OYh9ag0ZDHA.2580@TK2MSFTNGP12.phx.gbl...
    > I am just getting started with ASP.Net. I am attempting to place a
    dateGrid
    > on a page and I have done all the things I would do in a Windows
    > application:
    >
    > - drag a connection to the form
    > - preview the data
    > - generate a data set
    >
    > When I run the app I get:
    >
    > "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    > Server connection."
    >
    > string strConnectionString = "packet size=4096;user
    > id=MyUserName;password=MyPassword;integrated security=SSPI;data
    > source=MAGRATHEA;persist security info=False;initial catalog=Tracker";
    > cn.ConnectionString = strConnectionString;
    > da.Fill(ds.tblInfo);
    >
    > It fails on the .fill.
    >
    > The above works perfectly in a WinApp but apparently the user name is not
    > picked up as I would have thought. There is obviously some additional
    > voodoo I need to do on the web side.
    >
    >
    > Any help is greatly appreciated.
    >
    >

    Chris Jackson 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