到后台操作一段时间就公报错
但过一段时间就没事了,不知道为什么???
已下错误信息::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);
}
}
}
}
}
但过一段时间就没事了,不知道为什么???
已下错误信息::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);
}
}
}
}
}
解决方案 »
- js 获取 radioButtonList 选中值的问题
- sql
- 有没有好点的GridView组件,能有比较全的功能。
- 请问这样用可以吗?
- 异或运算符用”+” “-”替换后保持原有功能
- 关于上传图片 后格式 ,大小 发生变化的问题? 新人急问。
- ********************* cookie是否可以存数组??? *********************
- 求高手看看,这段代码那里出错了!
- json格式问题
- datagrid中添加了一列超级链接,可是上面的headtext中显示的字体是竖着的,奇怪
- 帮忙进来看一下触发器
- |zyciis| 为什么我的网站有时候提交数据的时候,就会出现浏览器死掉,只能用 “任务管理器” 来结束他
是这句话:MapPath("");你运行在当前目录路径:
protected static string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~") + "\\" +
protected static string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath(@"~") + "\\" +
protected string connectionString ="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath(@"~") + "\\" +
调试看看是否是字符串问题