产品使用及交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

求助:首页调取评论出错 [复制链接]

1#
新建模板如下:

<ul class="article">
<%
DataTable dt=Get_Data(string sql);
DataRow dr;
for(int i=0;i<dt.Rows.Count;i++)
{
dr=dt.Rows[i];
%>
<li><span class="title">
<a href="<%=Detail_Url(dr)%>" target="<%=Target%>" title="<%=Server.HtmlEncode(dr["title"].ToString())%>" style="<%=dr["pa_comments"]%>"><%=SubStr(dr["title"].ToString(),Title_Num,true)%></a></span>
<span class="date"><%=((DateTime)dr["thedate"]).ToString("MM-dd")%></span>
</li>
<%
}
%>
</ul>

[b]
出现如下错[/b]

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1513: } expected

Source Error:



Line 9:  <%}%><%conn.Open();%><ul class="article">
Line 10: <%
Line 11: DataTable dt=Get_Data(string sql);
Line 12: DataRow dr;
Line 13: for(int i=0;i<dt.Rows.Count;i++)
分享 转发
TOP
2#

DataTable dt=Get_Data(string sql);里面sql语句字符未定义
参考:http://bbs.pageadmin.net/showtopic-25798.aspx
TOP
3#

刚看到版主新做的代码,尝试一下,谢谢!
TOP
发新话题 回复该主题