In most cases the error should display on the screen.

However if it does not you can enable error reporting by editing your web.config file and adding the following inbetween <system.web> and /<system.web> tags:

<customErrors mode="Off"/>

Once done a more detailed error should appear on screen.

The error usually will indicate what the issue is.

If missing libraries. You may not be referencing the libraries to be used correctly within the web.config file

or 

more common is that the DB details are incorrect or missing or the db connection name does not match.


For example this error is returned from a particular site:

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

Server Error in '/' Application.


Could not find connection string with name 'conn' in application config file

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.ArgumentException: Could not find connection string with name 'conn' in application config file

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

As the error above indicates the connection name is wrong. Hence the connection string must be changed to the following in the web.config file:

<add name="conn" connectionString="Data Source=dbserveriporhostname;Persist Security Info=True;Initial Catalog=dbname;User ID=dbusername;Password=dbpassword;MultipleActiveResultSets=True;" ProviderName="System.Data.SqlClient" />




Răspunsul a fost util? 0 utilizatori au considerat informația utilă (0 Voturi)