通过查询数据库来展示xml文件,具体代码如下,老是报xml无法展示,请高手帮帮忙,这是什么问题应该怎样改呢?(是有特殊字符的,我已经替换了,但还是显示报错)急急
<%string category = "";
string link = "http://www.
SqlConnection con = new SqlConnection("server=.;uid=sa;pwd=sasa;database=ZUXIAN");
string sql = "select top(1) NewsTitle,SavePath,FileName,FileEXName,sNewsTitle,Content,NewsType,CreatTime from fs_news order by CreatTime desc";
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
for (int i = 0; i < dt.Rows.Count; i++)
{
//string s = dt.Rows[i]["Content"].ToString();
string s = dt.Rows[i]["Content"].ToString().Replace(" ", "").Replace("“", "").Replace("”", "").Replace("</p>", "").Replace("<p>", "").Replace("\r\n", "").Replace("<br />","");
%>
<item>
<title><%=s %></title>
</item>
<%
}
%>
[ 本帖最后由 zl123 于 2010-8-24 16:14 编辑 ]