DataRelation myDataRelation;//定義
myDataRelation = new DataRelation("CustOrd", ds.Tables["Customers"].Columns["CustomerID"], ds.Tables["Orders"].Columns["CustomerID"]);
// 加入關系
ds.Relations.Add(myDataRelation);
GridOrders.SetDataBinding(ds,"Customers");//主表
GridDetails.SetDataBinding(ds,"Customers.CustOrd");//明細