1. we have a SharePoint list with many elements
2. We will pass through the columna "Title", using the next code
It's is the simple way in SharePoint
Code.
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
namespace ProyectosSharePoint.LeerItems
{
public partial class LeerItemsUserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
SPWeb Web = SPContext.Current.Web;/// web context
SPList List = Web.Lists["ItemsSharePoint"]; ///Name of list
foreach (SPItem item in List.Items)
{
string ItemValue = item["Title"].ToString();///value of the field
}
}
}
}
Regards.
Oscar Miguel Dominguez Acevedo
No hay comentarios:
Publicar un comentario