Login failed for user 'test'.

Discussion in 'ASP .Net Security' started by Pai, Oct 6, 2003.

  1. Pai

    Pai Guest

    Hello there,

    I have a aspx page with the following code in the click event of a
    button.

    string myConnectionString =
    "server=ItnCentral;database=MembersCustom;user
    id=test;pwd=test;integrated security=false;";

    SqlConnection myCon = new SqlConnection (myConnectionString);

    string mySqlString = " select * from Cycle_Details";
    SqlDataAdapter myCmd = new SqlDataAdapter (mySqlString,myCon);

    DataSet my_dataset = new DataSet();

    myCmd.Fill (my_dataset,"Cycle_Details");

    foreach ( DataTable tb in my_dataset.Tables)
    {
    foreach ( DataRow rw in tb.Rows)
    {
    foreach( DataColumn cl in tb.Columns )
    {
    TextLastName.Text = rw[cl].ToString() ;
    }
    }

    I have added the user test to the logins section under Security
    options in the SQL Server and given db_datareader and db_datawriter
    roles to the user.

    But i still get the error.

    Any inputs / suggestions of how to go about this.

    Kind Regards,
    Pai.
    Pai, Oct 6, 2003
    #1
    1. Advertising

  2. Pai

    Lauchlan M Guest

    > I have a aspx page with the following code in the click event of a
    > button.


    > But i still get the error.


    What error?

    And what does your Web.config file look like?

    Lauchlan M
    Lauchlan M, Oct 7, 2003
    #2
    1. Advertising

  3. Pai

    Pai Guest

    "Lauchlan M" <> wrote in message news:<#>...
    > > I have a aspx page with the following code in the click event of a
    > > button.

    >
    > > But i still get the error.

    >
    > What error?
    >
    > And what does your Web.config file look like?
    >
    > Lauchlan M


    Hello Lauchlan,

    I get the following error:

    Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    the web.config file looks like below:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>

    <system.web>

    <compilation
    defaultLanguage="c#"
    debug="true"
    />

    <customErrors
    mode="RemoteOnly"
    />

    <authentication mode="Windows" />


    <authorization>
    <allow users="*" /> <!-- Allow all users -->
    </authorization>

    <trace
    enabled="false"
    requestLimit="10"
    pageOutput="false"
    traceMode="SortByTime"
    localOnly="true"
    />

    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
    cookieless="false"
    timeout="20"
    />

    <globalization
    requestEncoding="utf-8"
    responseEncoding="utf-8"
    />

    </system.web>

    </configuration>

    Kind Regards,
    Srikanth
    Pai, Oct 7, 2003
    #3
    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. =?Utf-8?B?U3lsdmFu?=
    Replies:
    4
    Views:
    5,376
    =?Utf-8?B?U3lsdmFu?=
    Nov 26, 2005
  2. Dennis
    Replies:
    0
    Views:
    4,035
    Dennis
    Jun 26, 2006
  3. CFTK
    Replies:
    5
    Views:
    485
  4. Homer
    Replies:
    3
    Views:
    7,951
    Alexey Smirnov
    Sep 25, 2007
  5. Tony Johansson
    Replies:
    3
    Views:
    16,088
    Patrice
    Jan 2, 2010
Loading...

Share This Page