How to UNION 2 selects when using EntityDataSource select command

549 views Asked by At

I am binding an EntityDataSource to a DataGrid in a web forms app and am using the Select property to join a few tables and return the result of the query, but I can't seem to find a way to UNION the result from 2 selects. Is there a way to do this or do I need to drop into the CommandText or convert to a standard DataSource that binds to the result of a Repository lookup that uses Linq.

Here is an example before the UNION is added:

<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>
0

There are 0 answers