Tuesday, March 14, 2017

Bind List Items to DataGrid

SPWeb oWebsite = SPContext.Current.Web;
SPList oList = oWebsite.Lists["List_Name"];
SPListItemCollection collListItems = oList.Items;

DataGrid1.DataSource = collListItems.GetDataTable();
DataGrid1.DataBind();


Reference: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.
splistitemcollection.getdatatable.aspx

No comments:

HOW TO RECOVER THE SQL DATABASE FROM SUSPECT MODE (Or) HOW TO BRING BACK THE SUSPECTED DATABASE TO THE NORMAL MODE When you logi...