Tuesday, July 27, 2010

Programmatically Adding SharePoint List

Adding list programmatically is pretty simple, all you need to do is grab the list collection for the current site and add a new list as shown below:

SPListCollection ListCollection = _spweb.Lists;
ListCollection.Add("Name", "Decription", SPListTemplateType.GenericList);

Its that simple you have just added a list called name with the description description to your sharepoint site.

No comments:

Post a Comment