Wednesday, 6 November 2013

SPListItemCollection to DataTable using C#

Share it Please
They code for converting the SPListItemCollection datas to datatable using c#

            SPWeb oWebsite = SPContext.Current.Web;
            SPList oList = oWebsite.Lists["CustomListName"];
            SPListItemCollection collListItems = oList.Items;
            DataTable dt=new DataTable();
            dt = collListItems.GetDataTable();

No comments:

Post a Comment

Followers

Follow The Author