Monday, October 19, 2015

How to get Field Name in Custom List Using Server Object Model

Server Object Model:
using(SPSite oSite = new SPSite("http://raghupc"))
{      
   using(SPWeb oWeb = oSite.OpenWeb())
   {
      SPList olist = oWeb.Lists["Employee"];

       foreach(SPField field in olist.Fields)
       {
           Console.WriteLine(field.Title);
Console.ReadLine();
       }
    }          
}

No comments:

Post a Comment