Some time we need to get data according to current user.
Like items that has been created by current login user.
And there so many approach to do this but what i will recommend that never goes wrong.
osb.Append(" <Where>")
osb.Append(" <Eq>")
osb.Append(" <FieldRef Name=""Author"" LookupId=""True"" />")
osb.Append(" <Value Type=""Lookup"" >" & SPContext.Current.Web.CurrentUser.ID & "</Value>")
osb.Append(" </Eq>")
osb.Append(" </Where>")
Just add this query and get what you wanted :D
No comments:
Post a Comment