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 errorSource Error: Line 43: connection = new OleDbConnection(connectionString); Line 44: if (connection.State == ConnectionState.Closed) Line 45: connection.Open(); Line 46: Line 47: OleDbCommand comm = new OleDbCommand(commandText, connection); Source File: h:\home\webs\qsh.in\friend_03a71a2f-37c5-4602-ad26-cf2ef4afd5f5\www\App_Code\DbHelperOleDb.cs Line: 45 你怎么不设置统一的错误页面 这样直接跳出错误提示很不安全
以前我做的时候,都是一个模块一个模块做的,到了最后重新界面设计,把这些模块在整合在一个系统中的,这个就是我的毕业合计。呵呵,给学校做的,现在正运行在学校服务器上。其实现在流行的DIV+CSS布局,楼主的网站里应该用到了这个。
string TempHtml = HtmlCode;
try
{
string Sql = "select id,title,img,adder,addtime,readsum,content from news where id=" + PageId;
SqlDataReader dr = db.SeleteDataDr(Sql);
string _NewsTitle = "";
string _NewsAdder = "";
string _NewsReadSum = "";
string _NewsAddtime = "";
string _NewsContent = "";
if (dr.Read())
{
_NewsTitle = dr["title"].ToString();
_NewsAdder = dr["adder"].ToString();
_NewsAddtime = dr["addtime"].ToString();
_NewsReadSum = dr["readsum"].ToString();
_NewsContent = dr["content"].ToString();
if (dr["img"].ToString().Trim() != "")
_NewsContent = "<img src='../upImg/" + dr["img"].ToString() + "' Border='0' style='MARGIN-BOTTOM:10px;MARGIN-RIGHT:10px;border-color:#E2E2E2;' align='left'>" + _NewsContent;
}
else
{
LabState.Text += "<br>" + PageId + " <font color='red'>该新闻不存在!</font>";
dr.Close();
return;
}
dr.Close();
TempHtml = TempHtml.Replace("NewsTitle", _NewsTitle.ToString());
TempHtml = TempHtml.Replace("NewsReadSum", _NewsReadSum.ToString());
TempHtml = TempHtml.Replace("NewsAdder", _NewsAdder.ToString());
TempHtml = TempHtml.Replace("NewsAddtime", _NewsAddtime.ToString());
TempHtml = TempHtml.Replace("NewsContent", _NewsContent.ToString());
TempHtml = TempHtml.Replace("readsumPageId", PageId.ToString());
TempHtml = TempHtml.Replace("'", Convert.ToString('"'));
//System.Text.Encoding enc = System.Text.Encoding.GetEncoding("gb2312");
string path = Server.MapPath("../news/") + PageId + ".shtm";
StreamWriter sw = new StreamWriter(path, false, System.Text.Encoding.GetEncoding("gb2312"));//定义写入流
sw.Write(TempHtml);//生成index.html
sw.Flush();
sw.Close();
LabState.Text += "<br>"+PageId + " 该新闻生成成功!";
}
catch (Exception ex)
{
LabState.Text += "<br>错误:" + ex.Message;
}这是我以前项目中的部分代码,拿出来看下。呵呵,不是很好
不知道照片中哪位是楼主 呵呵
类似于这样的页面,天头应该留大些。
最可能的原因是:
未连接到 Internet。
该网站遇到了问题。
在地址中可能存在键入错误。
用FireFox访问,页面布局混乱
--------------------------------------------------------------------------------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 errorSource Error:
Line 43: connection = new OleDbConnection(connectionString);
Line 44: if (connection.State == ConnectionState.Closed)
Line 45: connection.Open();
Line 46:
Line 47: OleDbCommand comm = new OleDbCommand(commandText, connection);
Source File: h:\home\webs\qsh.in\friend_03a71a2f-37c5-4602-ad26-cf2ef4afd5f5\www\App_Code\DbHelperOleDb.cs Line: 45 你怎么不设置统一的错误页面 这样直接跳出错误提示很不安全
www.codeusing.com