DataTable newCNBaskeItems = new DataTable();
newCNBaskeItems = basket.BasketItems.Clone();
DataTable newTWBaskeItems = new DataTable();
newTWBaskeItems = basket.BasketItems.Clone();
DataRow[] cnDataRow = basket.BasketItems.Select("OriginCode = 'cn'");
DataRow[] twDataRow = basket.BasketItems.Select("OriginCode = 'cn'");
foreach (DataRow r in cnDataRow)
{
newCNBaskeItems.Rows.Add(r.ItemArray);
}
foreach (DataRow r in twDataRow)
{
newTWBaskeItems.Rows.Add(r.ItemArray);
}
ShoppingCartDataList.DataSource = newCNBaskeItems;
ShoppingCartDataList.DataBind();
TaiwanCartList.DataSource = newTWBaskeItems;
TaiwanCartList.DataBind();
转载于:https://www.cnblogs.com/kerrylin/archive/2012/07/02/2572843.html