Click here to Skip to main content
11,583,859 members (63,530 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#4.0 Sharepoint
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
Edited 2-May-13 23:14pm
Sandeep Mewara at 2-May-13 9:51am
What have you tried so far?
lukeer at 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
0 OriginalGriff 480
1 Sergey Alexandrovich Kryukov 285
2 virusstorm 268
3 Dave Kreskowiak 230
4 Richard Deeming 220
0 OriginalGriff 1,623
1 Sergey Alexandrovich Kryukov 1,135
2 Abhinav S 701
3 Dave Kreskowiak 627
4 Suvendu Shekhar Giri 568

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2015
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