1.把这段代码注释一下试试 ds.Relations.Add("OrderDetails", ds.Tables[tblMaster].Columns["ProductID"], ds.Tables[tblDetail].Columns["ProductID"]);2.没太看懂