If you want to fetch the data from a custom list in the form of DataTable then use the following code snippet:
SPSite site = new SPSite(SPContext.Current.Site.Url); // To get the current site
SPList list = site.OpenWeb().Lists["ListName"]; //Getting instance of the list
DataTable dtList = list.Items.GetDataTable(); // Get list data in datatable
SharePoint Kings,Technosavvy guys hunting SharePoint Challenges... SharePoint 2013, SharePoint 2010, MOSS 2007, Windows Workflow Foundation, Project Server and Other Related Technologies.
Saturday, May 24, 2008
Subscribe to:
Post Comments (Atom)
Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!
If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com
No comments:
Post a Comment