Showing posts with label Sharepoint Read Large List. Show all posts
Showing posts with label Sharepoint Read Large List. Show all posts

Thursday, 15 May 2014

Sharepoint Read Large List

Sharepoint Best practice
using (SPSite site = new SPSite("http://SERVER:42204/Lists/"))
{
using (SPWeb web = site.OpenWeb())
{
SPList tasksList = web.Lists["Announcements"];
System.Data.DataTable dt;
int i = 0;
dt = tasksList.Items.GetDataTable();
foreach (System.Data.DataRow dr in dt.Rows)
{
Console.WriteLine(dr["Title"].ToString());
i++;
}
Console.WriteLine(i);
}
}