GibboK
GibboK

Reputation: 73988

EntityDataSource with a GridView WHERE Explnation

Hi I use a GridView with an EntityDataSource.

I need to FILTER data from EntityDataSource using WHERE. The Filter should use the ProviderUserKey (GUID DataType in my case) for the Current logged in User.

At the moment I use to retrive my Guid this code in Page_Load Event

Guid myActiveUser = (Guid)Membership.GetUser().ProviderUserKey;

Thanks guys!

Upvotes: 1

Views: 1173

Answers (1)

Devart
Devart

Reputation: 122042

Try using the code like the following:

Guid myActiveUser = (Guid)Membership.GetUser().ProviderUserKey;    
EntityDataSource1.Where = "it.User = " + myActiveUser.ToString();

Upvotes: 3

Related Questions