- public void createList()
- {
- using (SPSite osite = new SPSite("http://Enter url sharepoint site url"))
- {
- osite.AllowUnsafeUpdates = true;
- using (SPWeb oweb= osite.OpenWeb())
- {
- oweb.AllowUnsafeUpdates = true;
- // create new Generic list called "My List"
- oweb.Lists.Add("List Name", "Description", SPListTemplateType.GenericList);
- // create Text type new column called "My Column"
- SPList list = oweb.Lists["List Name"];
- list.Fields.Add("My Column", SPFieldType.Text, true);
- oSPWeb.AllowUnsafeUpdates = false;
- }
- oSPsite.AllowUnsafeUpdates = false;
- }
- }
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Gowtham RajamanickamPosted Mar 18, 2015, 1:11 PM
thank u so much Vijay..
Vijay SPosted Mar 18, 2015, 5:56 AM
Nice article