高手看看这段幻灯显示代码怎么修改?
OleDbDataAdapter da = new OleDbDataAdapter("select top 5 * from info where pic=1 and nclassid=26 order by id desc", conn);
DataTable dt = new DataTable();
da.Fill(dt);
for (int i = 0; i < dt.Rows.Count; i++)
{
strpics += dt.Rows[i]["DefaultPic"];
if (i < 4) { strpics += "|"; }
strlinks += "show.aspx?id=" + dt.Rows[i]["id"] + "|";
strtitles += dt.Rows[i]["title"] + "|";
}
conn.Close();
我想把 strlinks += "show.aspx?id=" + dt.Rows[i]["id"] + "|";// 这一句修改成两个索引strlinks += "show.aspx?id=" + dt.Rows[i]["id"] + "&"nid=" + dt.Rows[i]["nclassid"] + "|";但是运行时只显示id索引,却没有nid索引,为什么?怎么修改才对?谢谢 !!
------解决方案--------------------C# code
for(...)
{
...
strlinks += "show.aspx?id=" + dt.Rows[i]["id"] + "&nid=" + dt.Rows[i]["nclassid"] + "|";
...
}
strlinks = strlinks.Replace("'","\\'");//防止'截断字串
------解决方案--------------------
后台代码!!