Merge 使用方法
gv_sql.DataSource = dt1;
gv_sql.DataBind();
dt2 = GetDataTableXml();
gv_xml.DataSource = dt2;
gv_xml.DataBind();
//如果不設Key的話,即使ID重複也會顯示兩筆
dt1.PrimaryKey = new DataColumn[] { dt1.Columns["ID"] };
dt2.PrimaryKey = new DataColumn[] { dt2.Columns["ID"] };
//如果有設Key,設true則保留dt1的資料;設false則保留dt2的資料
dt1.Merge(dt2, true);
gv_merge.DataSource = dt1;
gv_merge.DataBind();