这不起作用:
var originalFinalShowsTable = Session["finalShowsTable"] as DataTable;
DataTable finalShowsTable = new DataTable();
finalShowsTable = originalFinalShowsTable.Clone();
foreach (GridViewRow gvr in gvShows.Rows)
{
if (gvr.RowType == DataControlRowType.DataRow)
{
if (((CheckBox) gvr.FindControl("cbSelect")).Checked)
{
finalShowsTable.Rows.Add(gvr);
}
}
}
它所做的是将文本"System.Web.UI.WebControls.GridViewRow"
放入数据表的第一列。