0

Server Error in '/' Application.

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

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: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Source Error: 


Line 54:             if (_con.State == ConnectionState.Closed)
Line 55:             {
Line 56:                 _con.Open();
Line 57:             }
Line 58:         }

Source File: D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs    Line: 56 

Stack Trace: 


[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009598
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5023255
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   WebMediSmart.AdminPages.HospitalMaster.InitializeConnection() in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:56
   WebMediSmart.AdminPages.HospitalMaster.GetHospital() in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:81
   WebMediSmart.AdminPages.HospitalMaster.Clear() in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:72
   WebMediSmart.AdminPages.HospitalMaster.Page_Load(Object sender, EventArgs e) in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Error getting while opening the page published in iis.The solution working perfectly in visual studio.

1 Answers1

0

I also faced same problem while deploying website on ISS but I get the solution from another page.

See this page ....

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path

My solution is

->Open IIS Manager and select application pools

->Select and right click on pool then select Advanced settings

->Select identity under process model and change it to LocalSystem.

->Restart your IIS or site and browse your web pages.

Problem solved ......!

Community
  • 1
  • 1
Nakul14
  • 13
  • 3