SPField

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.aspx

SPSite oSiteCollection = SPContext.Current.Site;
using (SPWeb oWebsite = oSiteCollection.AllWebs["Site_Name"])
{
    SPFieldCollection collFields = oWebsite.Lists["List_Name"].Fields;
    for (int intIndex = 0; intIndex < collFields.Count; intIndex++)
    {
        string[] strRefFields = collFields[intIndex].FieldReferences;

        if (strRefFields != null)
        {
            for (int intStrPos = 0; intStrPos < strRefFields.Length; 
                intStrPos++)
            {
                Label1.Text += collFields[intIndex].InternalName +
                " :: " + SPEncode.HtmlEncode(strRefFields[intStrPos]) 
                + "<BR>";
            }
        }
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s