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 3670882
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:25:09+00:00 2026-05-19T02:25:09+00:00

I’m trying to create a C# program using a Sharepoint Web Service reference that

  • 0

I’m trying to create a C# program using a Sharepoint Web Service reference that will accept user input every day and update a list. The data is potentially different every day so I need a reliable way to delete every item in the list before the update statement is sent for the new items.

The only way to delete an entry is by referencing its item ID number. I tried just creating a loop that’ll generate a delete statement that blankets ID 1-50, but since the list always increments that only works until 50 items go through. In my Googling I’ve found that the only way to reset a list to ID 1 is to delete it and recreate it. Unfortunately, if I do that, it’ll have a different GUID and my program will no longer be able to call it the next time it’s run.

Is there some solution I’m not seeing here?

  • 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-19T02:25:10+00:00Added an answer on May 19, 2026 at 2:25 am

    You can’t re-create a list with a specified GUID.

    But from your comment you’re off on a tangent here if the only reason you need to reset the ID to 1 is to help out with your empty list operation.

    The XML returned from GetListItems() is in the format

    <listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" 
       xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 
       xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" 
       xmlns="http://schemas.microsoft.com/sharepoint/soap/">
       <rs:data ItemCount="4">
          <z:row ows_Number_Field="6555.00000000000" 
             ows_Created="2003-06-18T03:41:09Z" 
             ows_ID="100" ows_owshiddenversion="3" />
          <z:row ows_Number_Field="78905456.0000000" 
             ows_Created="2003-06-18T17:15:58Z" 
             ows_ID="101" ows_owshiddenversion="2" />
             ...
       </rs:data>
    </listitems>
    

    So to ‘reliably’ loop through that is something like (not tested but you get the idea)

    // Call GetListItems and setup XmlDocument with results
    System.Xml.XmlNode nodeListItems = 
        listService.GetListItems
        (listName, viewName,query,viewFields,rowLimit,queryOptions,null);
    
    /*Loop through each node in the XML response and display each item.*/
    foreach (System.Xml.XmlNode listItem in nodeListItems)
    {
       Console.WriteLine("ID:{0}",listItem.getAttribute("ows_ID"));
    }
    

    See this MSDN article for more inspiration

    Further – to delete all these records with one call you can do a batch update by sending UpdateListItems by building up an XML fragment something like this in the for loop above.

    <Batch>
       <Method ID='1' Cmd='Delete'><Field Name='ID'>100</Field></Method>
       <Method ID='2' Cmd='Delete'><Field Name='ID'>101</Field></Method>
    </Batch>
    

    Notes

    • the “Method ID=’XXX’…” has to be
      sequential +1 for each batch method.
    • the “Field Name=’ID’100…” matches
      the ID’s of the list you found in the
      for loop above.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
Does anyone know how can I replace this 2 symbol below from the string

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.