Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Programmatically Create Document Library & Discussion Board

  Asked By: Rico    Date: Jan 17    Category: Sharepoint    Views: 21730

I have been asked to create a Document Library & Discussion Board for
each client in a sharepoint list.

Is there any way for me to use the SP stored procedures in a sql
script to automatically do this?



5 Answers Found

Answer #1    Answered By: Rashawn Hopper     Answered On: Jan 17

I have been asked  to create  a Document Library & Discussion Board for
each client  in a sharepoint  list.

Is there any way for me to use the SP stored  procedures in a sql
script to automatically  do this?

Answer #2    Answered By: Horace Coffey     Answered On: Jan 17

I don't understand your questions.

First, Document Libraries and Discussion Boards are not created in a
SharePoint List. Did you mean a SharePoint Site?

Second, every major software vendor that has provided an API to access
their database (including Microsoft) strongly discourages manipulating
data directly in the database. You should use the Object Model to create
these kinds of SharePoint resources. If you are interested, we will
print and mail you a 3' x 4' poster of the Microsoft Windows SharePoint
Services Object Model (API). Request your copy from our Web site today
(registration required):
http://www.mindsharp.com (look in the green box in the top right hand
corner or the page)

Answer #3    Answered By: Rigoberto Beard     Answered On: Jan 17

And the poster is WAY Sweet too.

Answer #4    Answered By: Alphonso Mckay     Answered On: Jan 17

I already had your posters which I am
sure will come in handy while I am trying to figure this out. I got
sidetracked on another project(big surprise).

Sorry my description was confusing. What I meant to say is I have a
list with over a thousand entries(mainly colleges and universities)
and my user wants to have a document  library and a discussion  thread
for each colleges and universities in the list  and I need to place
links to both in their list item. Since there are over 1000 entries
I was hoping to find a solution using stored  procedures and/or
custom code.

Answer #5    Answered By: Daron Oneill     Answered On: Jan 17

This could certainly be achieved using the SharePoint Object Model. For
instance, you could run code like this for each colleges/universities in
your list:

Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
Dim webs As SPWebCollection = siteCollection.AllWebs
Dim newSite As SPWeb = webs.Add("SiteName")

SPSite siteCollection = SPControl.GetContextSite(Context);
SPWebCollection webs = siteCollection.AllWebs;
SPWeb newSite = webs.Add("SiteName");