我需要正确的语法来完成这项工作。
编辑:
XAML:
<asp:EntityDataSource ID="EntityDataSource2" runat="server" ConnectionString="name=Entities"
DefaultContainerName="Entities" EnableDelete="True" EnableFlattening="False"
EnableInsert="True" EnableUpdate="True" EntitySetName="Plans" AutoGenerateWhereClause="true">
<WhereParameters>
<asp:ControlParameter ControlID="tbxSearch" Name="Name" Type="String" />
</WhereParameters>
</asp:EntityDataSource>
代码背后:
if (string.IsNullOrEmpty(tbxSearch.Text))
{
this.EntityDataSource1.Where =
"NOT it.Id IN (SELECT Id FROM Plans_PendingChange) ";//getting all the records instead of getting the proper records
}
else
{
this.EntityDataSource1.Where = "it.Name = @Name ";
}