龙海做网站费用,最新远程网站建设服务,ui交互设计师,泰州网站开发公司在使用DataSet的时候#xff0c;经常会根据遇到一些外键列。我们需要根据一些外键关联对结果集进行补充字段#xff0c;我们习惯使用的sql语句如下#xff1a; SELECT PurchaseID, UserName, OrderItemID, PaymentMethod, Quantity, Price, TransactionID, Notes, Cr…在使用DataSet的时候经常会根据遇到一些外键列。我们需要根据一些外键关联对结果集进行补充字段我们习惯使用的sql语句如下 SELECT PurchaseID, UserName, OrderItemID, PaymentMethod, Quantity, Price, TransactionID, Notes, CreateOn, Purchase.SuppliersID,Suppliers.Name AS Suppliers FROM Purchase,Suppliers where Purchase.SuppliersID Purchase.SuppliersID 但上面的sql语句在ADO.NET中返回强类型数据集的时候会出现问题不能生成默认的Insert/Update和Delete方法。怎么解决呢 SELECT PurchaseID, UserName, OrderItemID, PaymentMethod, Quantity, Price, TransactionID, Notes, CreateOn, SuppliersID, (SELECT Name FROM Suppliers WHERE (SuppliersID Purchase.SuppliersID)) AS Suppliers FROM Purchase 上面的sql语句就可以解决该问题不过效率方面会有影响。 转载于:https://www.cnblogs.com/lirenqing/archive/2009/04/30/1447180.html