日期:2014-05-18 浏览次数:20542 次
DataSet ds = new DataSet(); DataTable table=ds.Tables[0]; for (int i = 0; i < table.Rows.Count; i++) { object[] values = table.Rows[i].ItemArray; //values数组,就是当行一行记录的所有列的值 //..LZ自己写代码读取数组的值,使用values[0],values[1],... }
------解决方案--------------------
用StringBuilder
------解决方案--------------------
用StringBuilder
------解决方案--------------------
[code=C#]
string sqlSS = "select * from A_SysModule where ParentID = "+id;
DataSet dsSS = cs.DBOperate.GetDataSet(sqlSS);
int ssnS = dsSS.Tables[0].Rows.Count;
StringBuilder a = new StringBuilder();
a.Append(@" "+sahref1+"<b><font color='#336699'>"+(m+1)+"-"+(sm+1)+" "+sDr["ModName"].ToString()+"</font></b>"+sahref2+" "+line+" "+br+"");
if(ssnS == 0)
{
a.Append(@"");
}
else
{
for(int ssj = 0; ssj < ssnS;ssj++)
{
DataRow sDrS = dsSS.Tables[0].Rows[ssj];
a.Append(@" <a href='product_content.aspx?Type="+sDrS["ModName"].ToString()+"'><b><font color='#336699'>"+(m+1)+"-"+(sm+1)+"-"+(ssj+1)+" "+sDrS["ModName"].ToString()+"</font></b></a> "+line+" "+br+"");
}
}code]