Visualizzazione dei risultati da 1 a 5 su 5

Discussione: riproduzione errore

  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2001
    Messaggi
    532

    riproduzione errore

    Uso Asp.net, C#, database access e VS 2010.
    Non riesco a riprodurre in localhost un errore che capita quando la pagina è pubblicata sul web. Chi può aiutarmi?

    l'errore che mi spunta sul web è questo:

    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".




    <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.




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

  2. #2
    Utente di HTML.it
    Registrato dal
    Oct 2001
    Messaggi
    532

    scuse

    scusate spostatemi in asp.net

  3. #3
    Utente di HTML.it L'avatar di rsdpzed
    Registrato dal
    Aug 2001
    Messaggi
    764
    bhè cosi non si capisce nemmeno che erorre è, comincia col modificare il web.config come è suggerito, con <customErrors mode="Off"/> e poi riporta l'errore vero e proprio...

  4. #4
    Utente di HTML.it
    Registrato dal
    Oct 2001
    Messaggi
    532
    finalmente spunta l'errore:

    Server Error in '/' Application.

    Unspecified error

    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.OleDb.OleDbException: Unspecified error

    Source Error:


    Line 30: OleDbConnection cn = new OleDbConnection(connString);
    Line 31: // Apro la connessione
    Line 32: cn.Open();
    Line 33:
    Line 34: OleDbCommand cmd = new OleDbCommand(query, cn);




    la funzione incriminata è contenuta in un file funzioni.cs all'interno della cartella App_Code.
    ecco la funzione:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Collections;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    using System.Xml.Serialization;


    public class funzioni: System.Web.UI.Page
    {
    public OleDbDataReader recuperaDataByQuery(string query)
    {
    String connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("mdb-database/mydb.mdb");
    OleDbConnection cn = new OleDbConnection(connString);
    cn.Open();
    OleDbCommand cmd = new OleDbCommand(query, cn);
    OleDbDataReader aReader = cmd.ExecuteReader();
    cn.Close();
    return aReader;
    }
    }

  5. #5
    Utente di HTML.it L'avatar di rsdpzed
    Registrato dal
    Aug 2001
    Messaggi
    764
    prima prova a modificare la stringa di connessione cosi:

    codice:
    String connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/mdb-database/mydb.mdb");
    se non va guarda questo breve articolo se ti puo essere utile:

    http://blog.dotnetcode.it/post/2010/...-su-Aruba.aspx

    oppure contatta il tuo hosting


Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.