0

例如,

    <asp:EntityDataSource ID="edsPatient" runat="server" 
        ConnectionString="name=ReferralDBEntities" 
        DefaultContainerName="ReferralDBEntities" EnableFlattening="False" 
        EntitySetName="Patients" 
        Select="it, (it.FirstName + it.LastName) as FullName"

        >

但它不是对 SQL 执行的:

Select p.*, (p.FirstName + p.LastName) as FullName from Patients p

EntityDataSource 不支持通配符吗?

4

2 回答 2

2
<asp:TemplateField HeaderText="CoachName" SortExpression="FullName">
<ItemTemplate>
<asp:DropDownList ID="DDLPeopleID" runat="server"  CssClass="dropdown"
DataSourceID="PeopleEntityDS" DataTextField="FullName"  AppendDataBoundItems="true"
DataValueField="PeopleID"   SelectedValue='<%# Bind("CoachID") %>'>
<asp:ListItem Text="" value=""></asp:ListItem> </asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>

   <asp:EntityDataSource ID="PeopleEntityDS" runat="server" 
        ConnectionString="name=EQnetTableEntities" 
        DefaultContainerName="EQnetTableEntities" 
        EntitySetName="People"  AutoGenerateWhereClause ="false"
        Select="it.[PeopleID],(it.[FirstName]+' '+it.[LastName]) as FullName" OrderBy="it.PeopleID" 
         EnableFlattening="False">
    </asp:EntityDataSource>
于 2011-03-15T07:18:04.950 回答
1
asp:TemplateField   => DataTextField="FullName"  
EntityDatasource    =>  Select="it.[PeopleID],(it.[FirstName]+' '+it.[LastName]) as FullName" 
于 2011-03-15T07:21:27.837 回答