- Joined
- Apr 3, 2010
- Messages
- 2
- Reaction score
- 0
Hi,
I am using a gridview with ado.net entity framework. I am trying to filter my gridview records by userName equal to logged in user. But I don't know how to do this.
In asp:EntityDataSource I should use the Where clause, have tried the following:
<asp:EntityDataSource ID="DocumentsDataSource1" runat="server"
ConnectionString="name=iWEntities1"
DefaultContainerName="iWEntities1" EnableDelete="True"
EnableInsert="True" EnableUpdate="True" EntitySetName="GeneratedDocument"
EntityTypeFilter="GeneratedDocument"
Where="it.UserId = '<% Context.User.Identity.Name %>' ">
</asp:EntityDataSource>
didnt work.. also looked at the availabe where parameters such as ProfileParameter, Cookie param, etc.. dont see anything that would allow for getting the logged in user though. Any idea how to do this?
Thanks,
- R
I am using a gridview with ado.net entity framework. I am trying to filter my gridview records by userName equal to logged in user. But I don't know how to do this.
In asp:EntityDataSource I should use the Where clause, have tried the following:
<asp:EntityDataSource ID="DocumentsDataSource1" runat="server"
ConnectionString="name=iWEntities1"
DefaultContainerName="iWEntities1" EnableDelete="True"
EnableInsert="True" EnableUpdate="True" EntitySetName="GeneratedDocument"
EntityTypeFilter="GeneratedDocument"
Where="it.UserId = '<% Context.User.Identity.Name %>' ">
</asp:EntityDataSource>
didnt work.. also looked at the availabe where parameters such as ProfileParameter, Cookie param, etc.. dont see anything that would allow for getting the logged in user though. Any idea how to do this?
Thanks,
- R