Where do a set the right user rights for ASP.NET 2 to connect to a SQL servi
ce
Se below
//
Exception Details: System.Data.SqlClient.SqlException: Login failed for user
'NT AUTHORITY\NETWORK 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\NETWORK
SERVICE'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +735091
System.Data.SqlClient.TdsParser. ThrowExceptionAndWarning(TdsParserStateO
bjec
t
stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean
enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentit
y
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +17
0
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOpti
ons
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnec
tion owningConnection, DbConnectionPool pool, DbConnectionOptions options) +
28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable
,
IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectAr
guments arguments) +1770
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92
System.Web.UI.WebControls.ListControl.PerformSelect() +31
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42
//You have several choices.
You can either grant the machine's NT AUTHORITY\NETWORSERVICE 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="true" userName="sqlUserThatWorks"
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:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"TOLI" wrote:
> Where do a set the right user rights for ASP.NET 2 to connect to a SQL ser
vice
> Se below
> //
> Exception Details: System.Data.SqlClient.SqlException: Login failed for us
er
> 'NT AUTHORITY\NETWORK SERVICE'.
> Source Error:
> An unhandled exception was generated during the execution of the current w
eb
> request. Information regarding the origin and location of the exception ca
n
> be identified using the exception stack trace below.
> Stack Trace:
>
> [SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWORK
> SERVICE'.]
> System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection) +735091
> System.Data.SqlClient.TdsParser. ThrowExceptionAndWarning(TdsParserStateO
bj
ect
> stateObj) +188
> System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
> cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
> bulkCopyHandler, TdsParserStateObject stateObj) +1838
> System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean
> enlistOK) +33
> System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnecti
on
> owningObject, SqlConnectionString connectionOptions, String newPassword,
> Boolean redirectedUserInstance) +628
> System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdent
ity
> identity, SqlConnectionString connectionOptions, Object providerInfo, Stri
ng
> newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +
170
> System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOp
tions
> options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
> owningConnection) +359
> System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConn
ection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
+28
> System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
> owningObject) +424
> System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectio
n
> owningObject) +66
> System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
> owningObject) +496
> System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
> owningConnection) +82
> System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
> outerConnection, DbConnectionFactory connectionFactory) +105
> System.Data.SqlClient.SqlConnection.Open() +111
> System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
> DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTab
le,
> IDbCommand command, CommandBehavior behavior) +121
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecor
d,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> behavior) +137
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
+83
> System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelect
Arguments arguments) +1770
> System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92
> System.Web.UI.WebControls.ListControl.PerformSelect() +31
> System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
> System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
> System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
> System.Web.UI.Control.PreRenderRecursiveInternal() +77
> System.Web.UI.Control.PreRenderRecursiveInternal() +161
> System.Web.UI.Control.PreRenderRecursiveInternal() +161
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
> Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NE
T
> Version:2.0.50727.42
> //
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment