p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=560)
-   -   Server Error in '/' Application - Runtime Error (http://p2p.wrox.com/showthread.php?t=85782)

leeWozyWarren November 22nd, 2011 03:35 PM

Server Error in '/' Application - Runtime Error
 
Hi all,

I am FTPing a test site I have created in Visual Web Developer following the book.

I can get the site FTPed ok, but when I run it in a browser from the remote server at Netcetera I get the following error! Any thoughts as to why?

Code:

Server Error in '/' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>


Imar November 22nd, 2011 04:33 PM

Hard to say, as the real error is hidden. Could be anything from a web site configured for .NET 2 (my guess of the problem), to file permissions, database issues and more0. Your host should be able to figure out what the problem is by looking into Windows Event Viewer.

Cheers,

Imar

leeWozyWarren November 22nd, 2011 05:01 PM

If I upload a simple aspx page with no sql control on the page then it runs fine as seen here: www.essentiaclientmanager.com/default02.aspx

But I would guess that it has something to do with the SQL controls linking to a database...

leeWozyWarren November 22nd, 2011 05:03 PM

Is there something that I should be doing in respect of the database aspect of the website before moving it to the remote server?

Imar November 22nd, 2011 05:15 PM

If I try http://www.essentiaclientmanager.com/default02.aspx I get an error as well.

Did you try setting customErrors to false?

Imar

leeWozyWarren November 22nd, 2011 05:22 PM

Where are the custom errors set to false at? I have done a search and cannot find the location!

leeWozyWarren November 22nd, 2011 05:28 PM

I have added the custom errors element to the web.config. The page now shows the error:


Code:

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:

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): 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
  System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123
  System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +319
  System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
  System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1618
  System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +97
  System.Web.UI.WebControls.ListControl.PerformSelect() +34
  System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
  System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
  System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +29
  System.Web.UI.Control.PreRenderRecursiveInternal() +103
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Control.PreRenderRecursiveInternal() +175
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496


Imar November 22nd, 2011 05:36 PM

Sounds like you set up the site to use SQL Server Express. Does your host support that? Did they give you a connection string? They should be able to provide you with the details about setting up the database correctly.

Cheers,

Imar

leeWozyWarren November 22nd, 2011 06:01 PM

Yes they do support Express but they haven't given me a connection string... I'm finding it quite difficult dealing with them....

leeWozyWarren November 22nd, 2011 06:42 PM

Right. I finally have a connection string.


Data Source=sql1096.netcetera.co.uk;Initial Catalog=YOUR DATABASE NAME HERE;User Id=YOUR DATABASE USERNAME HERE;Password=YOUR DATABASEsomepwd

Where do I put this?


All times are GMT -4. The time now is 04:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.