我正在将EntityDataSource绑定到 Web 表单应用程序中的 DataGrid 并使用Select属性来连接几个表并返回查询结果,但我似乎无法找到一种方法来联合来自 2 个选择的结果。有没有办法做到这一点,或者我是否需要放入CommandText或转换为绑定到使用 Linq 的存储库查找结果的标准数据源。
这是添加 UNION 之前的示例:
<asp:EntityDataSource runat="server" id="DonationChildDataSource"
ConnectionString="name=myDonationEntities"
DefaultContainerName="myDonationEntities"
EnableFlattening="False"
EntitySetName="WPRecurringDonations"
OrderBy="it.id"
Select="it.WPOnetimeDonation.wponetime_donation_id as id,
it.WPOnetimeDonation.DonationOccurrenceType.donation_occurrence_type_tag as typeid,
it.WPOnetimeDonation.donation_amount as amount,
it.WPOnetimeDonation.Currency.currency_iso as currency_iso,
it.for_date as date,
it.merchant_code_used as merchant,
it.WPDonationStatus.wpdonation_status_tag as status,
it.worldpay_response
"
>
</asp:EntityDataSource>