Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Web Part structure

  Asked By: Marilyn    Date: Apr 15    Category: Sharepoint    Views: 985

I am curious to know about Web Part structure and model. Please help me
to answer

what is the mechanism by which that web part connects to the underlying
source of the data? What is the best model? Does that have any
implications on how we setup the servers or sites?



1 Answer Found

Answer #1    Answered By: Faith Delgado     Answered On: Apr 15

Not quite sure what you are asking.

WebParts are in a Webpart zone on a WebPart page so they automatically have
access to SharePoint. Code Access Security will need to be set properly for
them to access the SharePoint object model, but no other special steps need
to be taken.

If you are talking about a webpart that will be accessing a separate data
source like a SQL server database, then do it the same way you would access
such a database from a webpage. Create a Connection Object, a Command
Object, a data  Adapter and use those to fill a Data set. The only thing
that is different here is that Session state is turned off by default in
SharePoint so you can't cache the dataset in Session State. SharePoint has
its own caching mechanism  for things like this. If I remember correctly it
is called a PartCache. You must use a webpart that inherits from the
SharePoint webpart object model  to use it.

Didn't find what you were looking for? Find more on Web Part structure Or get search suggestion and latest updates.