Click here to Skip to main content
12,997,531 members (58,642 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How to get all items in list from sharepoint List using c#. Please Help me to solve this problem.

I am write code this code but its get only list item count.try to get list items but not working.

ClientContext context = new ClientContext("http://sezdmc445//_vti_bin/lists.asmx");
NetworkCredential cred = new NetworkCredential();
cred.UserName = "spadmin";
cred.Password = "abc@1234";
//context.UseDefaultCredentials = false;
context.Credentials = cred;
Web web = context.Web;
ListCollection lists = context.Web.Lists;       
string abc = "DL_ABCD";
foreach (List list in lists)
    if (list.Title ==  abc )
        string lisiitem12 = list.ItemCount.ToString();           
Posted 2-May-13 2:55am
Updated 2-May-13 23:14pm
Sandeep Mewara 2-May-13 9:51am
What have you tried so far?
lukeer 3-May-13 2:48am
What exactly is not working?
Do you get any error messages?
Can you narrow down what code line causes the error?

Nothing to do with your question, but you construct a StringBuilder instance using string concatenation. That's what the use of StringBuilder usually is there to prevent. Do you use it more afterwards?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100