Monday, November 30, 2009

Get List Data using SPView

Check code snippet:

SPWeb spWebTest = siteCollection.RootWeb.Webs["Test"];
SPList splTestDetails = spWebTest.Lists["TestTeam"];

//Get the Test person names from Test site
SPView spvTestPerson = splTestDetails.Views["TestPerson"];

DataTable dtTestPerson = splTestDetails.GetItems(spvTestPerson).GetDataTable();

No comments: