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

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

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

    Where do a set the right user rights for ASP.NET 2 to connect to a SQL service

    Se below
    //
    Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for user
    'NT AUTHORITY\NETWO RK SERVICE'.

    Source Error:

    An unhandled exception was generated during the execution of the current web
    request. Information regarding the origin and location of the exception can
    be identified using the exception stack trace below.

    Stack Trace:


    [SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWO RK
    SERVICE'.]
    System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
    exception, Boolean breakConnection ) +735091

    System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
    stateObj) +188
    System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior, SqlCommand
    cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet
    bulkCopyHandler , TdsParserStateO bject stateObj) +1838
    System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
    enlistOK) +33

    System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
    owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
    Boolean redirectedUserI nstance) +628

    System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
    identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance) +170

    System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
    options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
    owningConnectio n) +359

    System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +28
    System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
    owningObject) +424
    System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
    owningObject) +66
    System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
    owningObject) +496
    System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
    owningConnectio n) +82
    System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
    outerConnection , DbConnectionFac tory connectionFacto ry) +105
    System.Data.Sql Client.SqlConne ction.Open() +111
    System.Data.Com mon.DbDataAdapt er.FillInternal (DataSet dataset,
    DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
    IDbCommand command, CommandBehavior behavior) +121
    System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
    Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    behavior) +137
    System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +83

    System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteSelect(Da taSourceSelectA rguments arguments) +1770
    System.Web.UI.W ebControls.List Control.OnDataB inding(EventArg s e) +92
    System.Web.UI.W ebControls.List Control.Perform Select() +31
    System.Web.UI.W ebControls.Base DataBoundContro l.DataBind() +70
    System.Web.UI.W ebControls.Base DataBoundContro l.EnsureDataBou nd() +82
    System.Web.UI.W ebControls.List Control.OnPreRe nder(EventArgs e) +26
    System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +77
    System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
    System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
    System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1360

    Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET
    Version:2.0.507 27.42

    //

  • Peter Bromberg [C# MVP]

    #2
    RE: Login failed for user 'NT AUTHORITY\NETWO RK SERVICE'.

    You have several choices.
    You can either grant the machine's NT AUTHORITY\NETWO RSERVICE permissions
    in the Sql Server that it is attempting to connect to, or you can use a Sql
    Server authentication connection string with a userName and password, or you
    can even use the <identity impersonate="tr ue" userName="sqlUs erThatWorks"
    password="pass" /> element in web.config to make your app run under
    credentials that have SQL Server access.
    HTH
    Peter
    --
    Co-founder, Eggheadcafe.com developer portal:

    UnBlog:





    "TOLI" wrote:
    [color=blue]
    > Where do a set the right user rights for ASP.NET 2 to connect to a SQL service
    >
    > Se below
    > //
    > Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for user
    > 'NT AUTHORITY\NETWO RK SERVICE'.
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the current web
    > request. Information regarding the origin and location of the exception can
    > be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    >
    > [SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWO RK
    > SERVICE'.]
    > System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
    > exception, Boolean breakConnection ) +735091
    >
    > System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
    > stateObj) +188
    > System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior, SqlCommand
    > cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet
    > bulkCopyHandler , TdsParserStateO bject stateObj) +1838
    > System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
    > enlistOK) +33
    >
    > System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
    > owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
    > Boolean redirectedUserI nstance) +628
    >
    > System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
    > identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
    > newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance) +170
    >
    > System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
    > options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
    > owningConnectio n) +359
    >
    > System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +28
    > System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
    > owningObject) +424
    > System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
    > owningObject) +66
    > System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
    > owningObject) +496
    > System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
    > owningConnectio n) +82
    > System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
    > outerConnection , DbConnectionFac tory connectionFacto ry) +105
    > System.Data.Sql Client.SqlConne ction.Open() +111
    > System.Data.Com mon.DbDataAdapt er.FillInternal (DataSet dataset,
    > DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
    > IDbCommand command, CommandBehavior behavior) +121
    > System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
    > Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    > behavior) +137
    > System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +83
    >
    > System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteSelect(Da taSourceSelectA rguments arguments) +1770
    > System.Web.UI.W ebControls.List Control.OnDataB inding(EventArg s e) +92
    > System.Web.UI.W ebControls.List Control.Perform Select() +31
    > System.Web.UI.W ebControls.Base DataBoundContro l.DataBind() +70
    > System.Web.UI.W ebControls.Base DataBoundContro l.EnsureDataBou nd() +82
    > System.Web.UI.W ebControls.List Control.OnPreRe nder(EventArgs e) +26
    > System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +77
    > System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
    > System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
    > System.Web.UI.P age.ProcessRequ estMain(Boolean
    > includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1360
    >
    > Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET
    > Version:2.0.507 27.42
    >
    > //
    >[/color]

    Comment

    Working...