日期:2014-05-18 浏览次数:20711 次
ds.Tables.Add(dt); ds.Tables.Add(dt_dtl); CreateRelation(dt.Columns["id"], dt_dtl.Columns["id"], ds); // 创建关联 private void CreateRelation(DataColumn masterCol, DataColumn detailCol, DataSet ds) { DataRelation relCustOrder; relCustOrder = new DataRelation("CustomersOrders ", masterCol, detailCol); ds.Relations.Add(relCustOrder); }