ASP.NET access 出现“未指定的错误”

hj_huangjun 2010-01-17 09:25:12
在iis中,一开始运行没事,多点击几次,运行就出现问题,会出现“未指定的错误”

请问这是什么原因。有何解决办法?
网上查找了,说连接打开了 没关闭,可是我的reader和connection 都已经关闭了。请大家帮帮指点
...全文
657 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
hj_huangjun 2010-01-21
  • 打赏
  • 举报
回复
在自己的机子测试都没问题呢 可是在IIS里运行就会出问题 怎么调试啊
blackice8 2010-01-21
  • 打赏
  • 举报
回复
最简单的:你单步调试一下,看看具体的是那一行代码出错,然后排除这个bug就好呀
hj_huangjun 2010-01-21
  • 打赏
  • 举报
回复
主页面加载这些子窗体的时候就出现 “未指定的错误”大家帮忙指点指点啊
hj_huangjun 2010-01-21
  • 打赏
  • 举报
回复

cmd.Connection.Close();
cmd.Connection.Dispose();
cmd.Dispose()

这些代码是我后来加进去的 网上说connection 没关闭 我关闭了也是有同样的错误
我只是在局域网的另一台机器测试的 只有一个访问
hj_huangjun 2010-01-21
  • 打赏
  • 举报
回复
这是代码 希望大家给我看看
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>qydt_all</title>
<link href="../../bgManage/css/css_bg.css" rel="Stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="newstitle" runat="server" style="overflow-x:hidden; overflow-y:scroll; height:650px; width:822px;">
</div>
</form>
</body>
</html>

=================================================================================================

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
try
{
DbHelper db = new DbHelper();
DbCommand cmd = db.GetSqlStringCommond("select * from newsinfo where newscategory='企业动态' order by newsid desc");
DbDataReader reader = db.ExecuteReader(cmd);
string backstr = "<table>\r\n<tr>\r\n";
while (reader.Read())
{
backstr += "<td class=\"newstitle2\">\r\n";
backstr += "※ <a href=\"../News_show.aspx?id=" + reader["newsid"].ToString().Trim() + "\" target=\"_blank\">" + reader["newstitle"].ToString() + "</a></td>\r\n";
backstr += "<td class=\"newtime\">\r\n";
backstr += "<a>[" + reader["newsfabutime"].ToString() + "]</a></td>\r\n</tr>\r\n";
}
backstr += "</table>";
newstitle.InnerHtml = backstr;

reader.Close();
cmd.Connection.Close();
cmd.Connection.Dispose();
cmd.Dispose();
}
catch (Exception ee)
{
MessageBox.Show(this, ee.Message);
}
}
}
xray2005 2010-01-17
  • 打赏
  • 举报
回复
访问量是否过大了。你关键的代码贴出来看看呢
Valefish 2010-01-17
  • 打赏
  • 举报
回复

IISrest 看看
主要不知道错误信息...
wuyq11 2010-01-17
  • 打赏
  • 举报
回复
访问量是否过大
检查代码看看资源消耗情况
元宇宙之家 2010-01-17
  • 打赏
  • 举报
回复
“一开始运行没事,多点击几次,运行就出现问题”证明代码没有明显问题,估计是并发访问的问题。八成你的SqlConnection类是静态的,或是由静态方法创建的。取消静态属性即可。
wiki14 2010-01-17
  • 打赏
  • 举报
回复
代码,还有错误信息
鸭梨山大帝 2010-01-17
  • 打赏
  • 举报
回复
没代码没真相.

110,539

社区成员

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

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

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