Kashif Nizam Qureshi

SharePoint Query

Following are type of different options to query SharePoint List.

ID

query.Query=”<Where><Eq><FieldRef Name=’ID’ /><Value Type=’Counter’>23</Value></Eq></Where>”;

Guid

query.Query = “<Where><Eq><FieldRef Name=’WorkflowInstance’ /><Value Type=’Text’>{0ac4f897-0659-407b-86bd-78f96b45deb0}</Value></Eq></Where>”;

Lookup

query.Query = “<Where><Eq><FieldRef Name=’SurveyAnswer’ LookupId=’TRUE’ /><Value Type=’Lookup’>1</Value></Eq></Where>”;

Querying Multiple Fields

query.Query = “<Where><And><Eq><FieldRef Name=’ SurveyAnswerID’ LookupId=’TRUE’ /><Value Type=’Lookup’>1</Value></Eq><Eq><FieldRef Name=’UserName’ /><Value Type=’User’>kashif</Value></Eq></And></Where>”;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s