Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 442859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:06:49+00:00 2026-05-12T21:06:49+00:00

I need to check for duplicates. Currently I have items stored in sub folders

  • 0

I need to check for duplicates. Currently I have items stored in sub folders in a list.

How can I retrieve all items in the list from a web service, so I can check for duplicates?

Here is code from object model: I want to do exactly this, but from a web service

private static void PrintItemTitles()

{

    string strUrl = "http://localhost:8099/";

    using (SPSite site = new SPSite(strUrl))

    {

        using (SPWeb web = site.OpenWeb())

        {

            SPList list = web.Lists["MyList"];

            SPListItemCollection items = list.Items;



            foreach (SPListItem item in items)

                if (item != null)

                    Console.WriteLine(item.Title);

        }

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:06:49+00:00Added an answer on May 12, 2026 at 9:06 pm

    Use SPList.Items doesn’t return all items? Well, then try SPList.GetItems(SPQuery).

    Have a following SPQuery:

    SPQuery query = new SPQuery();
    query.ViewFields = "<FieldRef Name='ID'/><FieldRef Name='Title'/>";
    query.Query = String.Format("<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>{0}</Value></Eq></Where>", someItemTitle)
    query.MeetingInstanceId = -1; //In case if you query recurring meeting workspace - get items from all meetings
    query.RowLimit = 10; //Will you have more than 10 duplicates? Increase this value
    query.ViewAttributes = "Scope='RecursiveAll'"; //Also return items from folders subfolders
    

    Note: There could be some mistakes in code, because i`m writing from top of my head

    By executing this query and if it returns more than one item, then you have a duplicate!

    Edit: Ahh, sorry, you are talking about Web Services.

    Then this code won’t help. There are 2 options then:

    Option 1: You CAN create a view that
    does include items even from folders
    (flat view). See here for
    instructions
    .

    Option 2: According to Lists Web Service’s GetListItems method, you can pass QueryOptions parameter. Pass in

    <QueryOptions>
       <MeetingInstanceID>-1</MeetingInstanceID> <!-- Again, if you query recurring meeting, you want ALL items -->
       <ViewAttributes Scope='RecursiveAll' /> <!-- or Recursive if that does not work -->
    </QueryOptions>
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array like the one below, I need to check for duplicates
I need to check for duplicates before saving to the database in the create
I need to check some settings for all users on Windows clients in the
Need advise I am currently using CRM4.0 webservice to create account from reading my
How can I check for duplicates before inserting into a table when inserting by
I have a table, sessionBasket, that holds a list of the items in the
Here at work, we often need to find a string from the list of
Before inserting data into table i need to check against duplicate records and report
I am having endless troubles with duplicate entries, so I need to check the
I need to check for a condition on each page I visit on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.