Professional Web Applications Themes

Newbie Question - "trusted SQL Server connection" - ASP.NET Security

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 ...

  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. #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" <gjsumn.edu> wrote in message
    news:OYh9ag0ZDHA.2580TK2MSFTNGP12.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

Similar Threads

  1. Newbie question: How can I create a "tiled" background?
    By michaaal in forum Macromedia Flash
    Replies: 2
    Last Post: April 2nd, 06:05 AM
  2. "Connection closed by remote server" error in Opera
    By BGS in forum ASP.NET General
    Replies: 0
    Last Post: July 24th, 07:40 PM
  3. Replies: 2
    Last Post: July 19th, 08:03 PM
  4. Replies: 5
    Last Post: July 9th, 05:25 AM
  5. Replies: 0
    Last Post: January 9th, 06:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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