到后台操作一段时间就公报错
但过一段时间就没事了,不知道为什么???
已下错误信息::Server Error in '/' Application.
--------------------------------------------------------------------------------未指定的错误 
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.Exception: 未指定的错误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: 
[Exception: 未指定的错误]
   DbHelperSQL.GetSingle(String SQLString) +229
   DbHelperSQL.Exists(String strSql) +5
   login.ImgButLogin_Click(Object sender, ImageClickEventArgs e) +269
   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +86
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 public class DbHelperSQL
{
      
   
       protected static string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~") + "\\" + System.Web.Configuration.WebConfigurationManager.AppSettings["DataPath"];
        public DbHelperSQL()
        {
        }public static int ExecuteSql(string SQLString)
        {
            using (OleDbConnection connection = new OleDbConnection(connectionString))
            {
                using (OleDbCommand cmd = new OleDbCommand(SQLString, connection))
                {
                    try
                    {
                        connection.Open();
                        int rows = cmd.ExecuteNonQuery();
                        return rows;
                    }
                    catch (System.Data.OleDb.OleDbException E)
                    {
                        connection.Close();
                        throw new Exception(E.Message);
                    }
                }
            }
        }
}

解决方案 »

  1.   

    DbHelperSQL.GetSingle(String SQLString) +229  函数,抛出异常,请调试一下这里。
      

  2.   

    底层有异常按楼上的检查一下这个方法GetSingle(String sqlString)
      

  3.   

       
    是这句话:MapPath("");你运行在当前目录路径:
    protected static string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~") + "\\" + 
      

  4.   


    protected static string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath(@"~") + "\\" + 
      

  5.   


    protected string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath(@"~") + "\\" + 
      

  6.   

    protected static string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~") + @"/" + System.Web.Configuration.WebConfigurationManager.AppSettings["DataPath"];
    调试看看是否是字符串问题