DataSet ds = ct.ListArticle(15);
DataTable dt = ds.Tables[0].Clone();
DataRow dr = dt.NewRow();
if (ds != null)
{
for (int i = 0; i < (ds.Tables[0].Rows.Count > 10 ? 10 : ds.Table[0].Rows.Count); i++)
{
dr = ds.Tables[0].Rows[i];
dt.Rows.Add(dr.ItemArray);
}
rpterNewsList.DataSource = dt;
rpterNewsList.DataBind();
}
DataTable dt = ds.Tables[0].Clone();
DataRow dr = dt.NewRow();
if (ds != null)
{
for (int i = 0; i < (ds.Tables[0].Rows.Count > 10 ? 10 : ds.Table[0].Rows.Count); i++)
{
dr = ds.Tables[0].Rows[i];
dt.Rows.Add(dr.ItemArray);
}
rpterNewsList.DataSource = dt;
rpterNewsList.DataBind();
}
注:N=10!