大侠帮帮小弟吧.System.Data.OleDb.OleDbException: 未指定的错误.在线等

glicine 2007-08-27 09:57:27
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.Data.OleDb.OleDbException: 未指定的错误

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:


[OleDbException (0x80004005): 未指定的错误]
RuiYi.DbHelper.DBHELPER.ExectueDataRow(String strsql) in D:\ruri\DbHelper\DBHELPER.cs:127
RuiYi.SystemDLL.PubList.Get_ID_PubList(Int32 PubListID) in D:\ruri\SystemDLL\PubList.cs:60
Contrls_PubList.DB() in d:\ruri\web\Contrls\PubList.ascx.cs:26
Contrls_PubList.Page_Load(Object sender, EventArgs e) in d:\ruri\web\Contrls\PubList.ascx.cs:18
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061




--------代码下.有关闭数据库连接了还是会出现这种错误-----------
public void Close()
{
if (conn != null)
{
conn.Close();
conn.Dispose();
}
}
public DataRow ExectueDataRow(string strsql)
{
DataSet ds = null;
try
{
Open();
da = new OleDbDataAdapter(strsql, conn);
ds = new DataSet();
da.Fill(ds);
}
catch (Exception exception1)
{
throw exception1;
}
finally
{
Close();
}
if (ds.Tables[0].Rows.Count < 1)
{
return null;
}
return ds.Tables[0].Rows[0];
}

急.\线等....
...全文
112 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
glicine 2007-08-27
  • 打赏
  • 举报
回复
OK.问题终于被自个解决掉了.哎.郁闷呀...为什么要外加个da.dispose呢??
glicine 2007-08-27
  • 打赏
  • 举报
回复
本地测试一切正常..怎么样都没有出错..就上传服务器..出现这种错误..
#region 上一条产品内容
public DataRow Get_Panl_PubList(int PubListID)
{
string sql = string.Format("select top 1 * from PubList where PubListID<{0} order by PubListID desc", PubListID);
return db.ExectueDataRow(sql);
}
#endregion

#region 下一条产品内容
public DataRow Get_Next_PubList(int PubListID)
{
string sql = string.Format("select top 1 * from PubList where PubListID>{0}", PubListID);
return db.ExectueDataRow(sql);
}
#endregion
ztenv 2007-08-27
  • 打赏
  • 举报
回复
贴出完整的代码吧,并指出出错的位置,

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧