database login failed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chuck Bowling

    #1

    database login failed

    I'm having a problem that i really don't understand. I'm new to ASP.NET and
    to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work.

    I think the problem is permissions but I'm not sure. I've tried adding the
    ZEUS\ASPNET user to the server using osql with the command "EXEC
    sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the
    error page that was generated when I tried to build and run the site:


    Server Error in '/MyWebForm' Application.
    --------------------------------------------------------------------------------

    Login failed for user 'ZEUS\ASPNET'.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for user
    'ZEUS\ASPNET'.

    Source Error:

    Line 26: public void FillDataSet(MyD ataSet dSet)
    Line 27: {
    Line 28: sqlDataAdapter1 .Fill(dSet);
    Line 29: }
    Line 30:

    Source File: d:\inetpub\wwwr oot\mywebform\c omponent1.cs Line: 28

    Stack Trace:

    [SqlException: Login failed for user 'ZEUS\ASPNET'.]
    System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
    isInTransaction )
    System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString
    options, Boolean& isInTransaction )
    System.Data.Sql Client.SqlConne ction.Open()
    System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
    ConnectionState & originalState)
    System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
    startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    CommandBehavior behavior)
    System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
    Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    behavior)
    System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
    MyWebForm.Compo nent1.FillDataS et(MyDataSet dSet) in
    d:\inetpub\wwwr oot\mywebform\c omponent1.cs:28
    MyWebForm.WebFo rm1.Page_Load(O bject sender, EventArgs e) in
    d:\inetpub\wwwr oot\mywebform\w ebform1.aspx.cs :24
    System.Web.UI.C ontrol.OnLoad(E ventArgs e)
    System.Web.UI.C ontrol.LoadRecu rsive()
    System.Web.UI.P age.ProcessRequ estMain()



  • Aaron

    #2
    Re: database login failed

    Do you have the connection string? Try using Trusted Connection and see
    how that goes. You can get an example from www.connectionstrings.com

    Aaron

    Comment

    • Chuck Bowling

      #3
      Re: database login failed

      Yes I tried using Trusted Connection. The result was pretty much the same...

      I'll check the link - thanks...

      "Aaron" <wislang@gmail. com> wrote in message
      news:1120413071 .764216.11810@g 44g2000cwa.goog legroups.com...[color=blue]
      > Do you have the connection string? Try using Trusted Connection and see
      > how that goes. You can get an example from www.connectionstrings.com
      >
      > Aaron
      >[/color]


      Comment

      • Eliyahu Goldin

        #4
        Re: database login failed

        First of all, it is much easier to use sql authentication. Try it first and
        see if you can connect and the program works. Having done that, you can try
        to switch to windows authentication. On the database server you need to
        create a local user account with exactly the same user name and password as
        the one for running asp.net on the web server. For example, if asp.net on
        the web server runs under account "aspnet" with password "123456", you need
        to create a local user account with user name "aspnet" and password "123456"
        on the database server. Then you create a sql server logon for this local
        account.

        Eliyahu

        "Chuck Bowling" <chuckbowling@s bcglobal-NO-SPAM.net> wrote in message
        news:uLOqYW$fFH A.3912@TK2MSFTN GP14.phx.gbl...[color=blue]
        > I'm having a problem that i really don't understand. I'm new to ASP.NET[/color]
        and[color=blue]
        > to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work.
        >
        > I think the problem is permissions but I'm not sure. I've tried adding the
        > ZEUS\ASPNET user to the server using osql with the command "EXEC
        > sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the
        > error page that was generated when I tried to build and run the site:
        >
        >
        > Server Error in '/MyWebForm' Application.
        > --------------------------------------------------------------------------[/color]
        ------[color=blue]
        >
        > Login failed for user 'ZEUS\ASPNET'.
        > Description: An unhandled exception occurred during the execution of the
        > current web request. Please review the stack trace for more information
        > about the error and where it originated in the code.
        >
        > Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for[/color]
        user[color=blue]
        > 'ZEUS\ASPNET'.
        >
        > Source Error:
        >
        > Line 26: public void FillDataSet(MyD ataSet dSet)
        > Line 27: {
        > Line 28: sqlDataAdapter1 .Fill(dSet);
        > Line 29: }
        > Line 30:
        >
        > Source File: d:\inetpub\wwwr oot\mywebform\c omponent1.cs Line: 28
        >
        > Stack Trace:
        >
        > [SqlException: Login failed for user 'ZEUS\ASPNET'.]
        > System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
        > isInTransaction )
        >[/color]
        System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne c
        tionString[color=blue]
        > options, Boolean& isInTransaction )
        > System.Data.Sql Client.SqlConne ction.Open()
        > System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
        > ConnectionState & originalState)
        > System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
        > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
        > CommandBehavior behavior)
        > System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32[/color]
        startRecord,[color=blue]
        > Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
        > behavior)
        > System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
        > MyWebForm.Compo nent1.FillDataS et(MyDataSet dSet) in
        > d:\inetpub\wwwr oot\mywebform\c omponent1.cs:28
        > MyWebForm.WebFo rm1.Page_Load(O bject sender, EventArgs e) in
        > d:\inetpub\wwwr oot\mywebform\w ebform1.aspx.cs :24
        > System.Web.UI.C ontrol.OnLoad(E ventArgs e)
        > System.Web.UI.C ontrol.LoadRecu rsive()
        > System.Web.UI.P age.ProcessRequ estMain()
        >
        >
        >[/color]


        Comment

        • Chuck Bowling

          #5
          Re: database login failed

          Thanks for the response Eliyahu. I intend to try your suggestion when I get
          more time.

          I decided to go with what I know for now. I put the database in an XML Typed
          Dataset. Since it's on a server where I'm the only one with access,
          hopefully security won't be a problem and it bypasses the whole login issue.

          "Eliyahu Goldin" <removemeegoldi n@monarchmed.co m> wrote in message
          news:eHm5fOHgFH A.2372@TK2MSFTN GP14.phx.gbl...[color=blue]
          > First of all, it is much easier to use sql authentication. Try it first
          > and
          > see if you can connect and the program works. Having done that, you can
          > try
          > to switch to windows authentication. On the database server you need to
          > create a local user account with exactly the same user name and password
          > as
          > the one for running asp.net on the web server. For example, if asp.net on
          > the web server runs under account "aspnet" with password "123456", you
          > need
          > to create a local user account with user name "aspnet" and password
          > "123456"
          > on the database server. Then you create a sql server logon for this local
          > account.
          >
          > Eliyahu
          >
          > "Chuck Bowling" <chuckbowling@s bcglobal-NO-SPAM.net> wrote in message
          > news:uLOqYW$fFH A.3912@TK2MSFTN GP14.phx.gbl...[color=green]
          >> I'm having a problem that i really don't understand. I'm new to ASP.NET[/color]
          > and[color=green]
          >> to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work.
          >>
          >> I think the problem is permissions but I'm not sure. I've tried adding
          >> the
          >> ZEUS\ASPNET user to the server using osql with the command "EXEC
          >> sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the
          >> error page that was generated when I tried to build and run the site:
          >>
          >>
          >> Server Error in '/MyWebForm' Application.
          >> --------------------------------------------------------------------------[/color]
          > ------[color=green]
          >>
          >> Login failed for user 'ZEUS\ASPNET'.
          >> Description: An unhandled exception occurred during the execution of the
          >> current web request. Please review the stack trace for more information
          >> about the error and where it originated in the code.
          >>
          >> Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for[/color]
          > user[color=green]
          >> 'ZEUS\ASPNET'.
          >>
          >> Source Error:
          >>
          >> Line 26: public void FillDataSet(MyD ataSet dSet)
          >> Line 27: {
          >> Line 28: sqlDataAdapter1 .Fill(dSet);
          >> Line 29: }
          >> Line 30:
          >>
          >> Source File: d:\inetpub\wwwr oot\mywebform\c omponent1.cs Line: 28
          >>
          >> Stack Trace:
          >>
          >> [SqlException: Login failed for user 'ZEUS\ASPNET'.]
          >> System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
          >> isInTransaction )
          >>[/color]
          > System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne c
          > tionString[color=green]
          >> options, Boolean& isInTransaction )
          >> System.Data.Sql Client.SqlConne ction.Open()
          >> System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
          >> ConnectionState & originalState)
          >> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
          >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
          >> CommandBehavior behavior)
          >> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32[/color]
          > startRecord,[color=green]
          >> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
          >> behavior)
          >> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
          >> MyWebForm.Compo nent1.FillDataS et(MyDataSet dSet) in
          >> d:\inetpub\wwwr oot\mywebform\c omponent1.cs:28
          >> MyWebForm.WebFo rm1.Page_Load(O bject sender, EventArgs e) in
          >> d:\inetpub\wwwr oot\mywebform\w ebform1.aspx.cs :24
          >> System.Web.UI.C ontrol.OnLoad(E ventArgs e)
          >> System.Web.UI.C ontrol.LoadRecu rsive()
          >> System.Web.UI.P age.ProcessRequ estMain()
          >>
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...