0

我有一个 EntityDataSource:

<asp:EntityDataSource ID="EntityDataSourcePersoneel"
            runat="server"
            ConnectionString="name=HotelTestDatabaseEntities"
            DefaultContainerName="HotelTestDatabaseEntities"
            EntitySetName="Personeels"
            Include="Afdeling">
   </asp:EntityDataSource>

我动态添加这些 WhereParameters:

EntityDataSourcePersoneel.WhereParameters.Clear();
   EntityDataSourcePersoneel.AutoGenerateWhereClause = true;
   EntityDataSourcePersoneel.WhereParameters.Add("personeelID", TypeCode.Int32  
   personeelId.ToString());

如何检查 WhereParameters 是否返回 0 行(无)?

哦,是的,如果我的代码是错误的,请帮助和建议我.. 谢谢!

4

1 回答 1

1

使用OnSelected查询完成后将发生的事件:

protected void EntityDataSourcePersoneel_OnSelected(object Sender, EntityDataSourceSelectedEventArgs e)
{
     if(e.TotalRowCount == 0)
     {
          //Whatever
     }
}

阅读更多:这里

于 2012-06-18T10:23:54.150 回答