我有一个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行(无)?
哦是的,如果我的代码错了,请帮助并告诉我..谢谢!
答案 0 :(得分:1)
使用查询完成后将发生的OnSelected
事件:
protected void EntityDataSourcePersoneel_OnSelected(object Sender, EntityDataSourceSelectedEventArgs e)
{
if(e.TotalRowCount == 0)
{
//Whatever
}
}
了解详情:here