Solved

ASPNETDB.MDF from Host Server ---  Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Posted on 2008-10-06
2
967 Views
Last Modified: 2012-05-05
I ran into a problem transfering the website from the developer box to the host box.   I developed in 2008 VDE and 2008 SQL Express.  From the error I am guessing there is a problem with the website connecting to the database.

So I used asp.net Frameworks Reg SQL on the Host Box Located:
("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe")

Then I changed the Machine.Config File on the Host box also Located
("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config")
I modified the connection string to this -

  <connectionStrings>
    <add name="LocalSqlServer" connectionString="data source=AMCAP000;Integrated Security=SSPI;User Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>


Any suggestions on how to make this work?

Server Error in '/ACF' Application.

--------------------------------------------------------------------------------
 

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

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.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
 

Source Error: 
 
 

Line 19:     public virtual string MyTheme {

Line 20:         get {

Line 21:             return ((string)(this.GetPropertyValue("MyTheme")));

Line 22:         }

Line 23:         set {

 
 

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\acf\233ceae2\35975430\App_Code.qtodrcie.0.cs    Line: 21 
 

Stack Trace: 
 
 

[SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]

   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844759

   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194

   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392

   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35

   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144

   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342

   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221

   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189

   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185

   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31

   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433

   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499

   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65

   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117

   System.Data.SqlClient.SqlConnection.Open() +122

   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87

   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221

   System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +772

   System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +433

   System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +258

   System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +132

   System.Configuration.SettingsBase.get_Item(String propertyName) +102

   System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36

   System.Web.Profile.ProfileBase.get_Item(String propertyName) +68

   System.Web.Profile.ProfileBase.GetPropertyValue(String propertyName) +7

   ProfileCommon.get_MyTheme() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\acf\233ceae2\35975430\App_Code.qtodrcie.0.cs:21

   _Default.Page_PagePrePreInit(Object sender, EventArgs e) in G:\WEBSITE\ACF\Default.aspx.vb:5

   System.Web.UI.Page.OnPreInit(EventArgs e) +8694814

   System.Web.UI.Page.PerformPreInit() +31

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
 

 
 
 

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

Open in new window

0
Comment
Question by:HarleySkater
  • 2
2 Comments
 
LVL 1

Author Comment

by:HarleySkater
ID: 22649954
I commented out all the theme refrences in my aspx.vb pages behind code and the website it up, but of course without Profiling :*(  I am back on my developer box tryinig to configure the website to remotely connect to the aspnetdb I have on the Host Box :)

Provider Management  
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.  

Provider Management  

Could not establish a connection to the database. 

If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.  

Open in new window

0
 
LVL 1

Accepted Solution

by:
HarleySkater earned 0 total points
ID: 22650522
The following message may help in diagnosing the problem: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 141)

so I am going to try to go to my machine.config file first... well actually I am just going to delete it and then reinstall asp.net 3.5
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now