Creating Sharepoint Site collections & Document Library under it programmatically
-
Please provide me pointers (detailed info, if available) on how to create a sharepoint site collection and a document library under it dynamically. Appreciate your time and effort.
-
Please provide me pointers (detailed info, if available) on how to create a sharepoint site collection and a document library under it dynamically. Appreciate your time and effort.
In some cases we need to add documents to the doument library programatically, the code snippet below demonstrates how to add a document to the document library . using (SPSite objSite = new SPSite("urlAddress")) { objSite.AllowUnsafeUpdates = true; using (SPWeb oSPWeb = objSite.OpenWeb()) { oSPWeb.AllowUnsafeUpdates = true; //Test1 is the document library SPList docLibrary = oSPWeb.Lists["Test1"]; http://www.mindfiresolutions.com/Programatically-adding-a-document-to-document-library-in-SharePoint-709.php[^]
Cheers, Eliza