产品使用及交流论坛

首页 » 产品使用交流区 » 安装及使用交流 » 求助:首页调取评论出错
ole - 2013/8/19 14:16:07
新建模板如下:

<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++)
xiyou - 2013/8/19 15:23:35
DataTable dt=Get_Data(string sql);里面sql语句字符未定义
参考:http://bbs.pageadmin.net/showtopic-25798.aspx
ole - 2013/8/19 16:25:04
刚看到版主新做的代码,尝试一下,谢谢!
1
查看完整版本: 求助:首页调取评论出错