我有一个包含多个连接表的查询,这是一个简单的版本,我有很多这样的连接级别:
SELECT ApplicationField.OID, ApplicationField.FieldName, ApplicationField.Label, ApplicationField.DataType, ApplicationField.Length, ApplicationField.FieldType, ApplicationField.DefaultValue, ApplicationField.DataPrefix,
ApplicationField.DisplaySequence, ApplicationField.TabNumber, ApplicationField.Required, ApplicationField.Hidden, ApplicationField.PasswordField, ApplicationField.Loopback, ApplicationField.ApplicationVersion,
ApplicationField.OptimisticLockField, FieldQuery.QueryID, FieldQuery.ApplicationField, FieldQuery.ExecuteSequence, FieldQuery.MaxRows, FieldQuery.ReturnField, FieldQuery.QueryType
FROM ApplicationField LEFT OUTER JOIN
FieldQuery ON ApplicationField.OID = FieldQuery.ApplicationField
WHERE(ApplicationField.ApplicationVersion = @versionOID)
ORDER BY ApplicationField.TabNumber, ApplicationField.DisplaySequence
如何使用返回多个相关表的单个SQl语句来使用Datareader或DataAdapter,使表在数据集中保持独立,以便为ApplicationFields和相关的FieldQueries提供单独的表?每个应用程序字段可能有多个FieldQueries,一对多关系。