article is taken from the book SharePoint 2010
Web Parts in Action. The author shows
you different ways to query a standard Tasks list for all items that have the
status set to Completed.
off any version of SharePoint 2010 Web Parts in
Action with the checkout code dnspark40. Offer is only valid through
Sandboxed Solutions or User Code Solutions are giving SharePoint a whole new
level of extensibility. It allows the end-users to build their own, download, or
buy reusable solutions that can be used in the farm without involvement of
administrators. These solutions can also be installed without having downtime of
your web applications.
The Sandbox is a service in SharePoint Foundation
called Microsoft SharePoint Foundation Sandboxed Code Service in which all
Sandboxed solutions is executed. This process runs separately from the rest of
SharePoint so any crashes or hiccups in the Sandbox will not affect SharePoint.
SharePoint communicates with the Sandbox using a proxy and vice versa. The code
executing inside a Sandbox is deployed to the database but never ends up in the
file system. The sandboxed worker process has very limited security policies.
For instance, you are not allowed to call web services or use custom database
connections. You can add Web Parts, lists, workflows, and content types and you
can use event receivers in a Sandboxed solution.
Sandboxed solutions are
deployed into the Solution gallery of a Site Collection. This also means that
sandboxed solutions can only access information within the site collection it is
deployed into. To deploy a solution into the Solution Gallery, you go to Site
Settings of the root web of the Site Collection and choose the gallery called
Solutions. By selecting the Solutions tab in the Ribbon and clicking on the
Upload Solution button, you can upload a WSP package to the gallery. When the
solution package is uploaded, it appears in the solution gallery. You can select
the solution and click Activate in the Ribbon to activate it or Deactivate to
deactivate the solution (see figure 1). To be able to install Sandboxed
solutions the user has to be a Site Collection owner, so not everyone is allowed
to install Sandboxed solutions.Figure
1 The Solution Gallery in a Site Collection is used to manage the Sandboxed
solutions. Solutions can be activated, deactivated, and upgraded and the current
resource usage is shown for the entire Site Collection and each
SharePoint monitors all solutions running in the sandbox and
logs counters such as CPU usage, thrown exceptions, database queries, and so on.
Each usage of resources is logged and given points, as seen in figure 1. When
the total points from one or more solutions in one Site Collection reaches a
certain threshold, the Sandbox for the Site Collection will be shut down and the
users will not be able to use the solutions until the usage is reset. The point
quota is per day, so after 24 hours, the solutions are available once again. To
prevent a single sandboxed solution from shutting down all of the other
solutions in the sandbox, it is crucial that you make solutions that do not
throw unhandled exceptions, make unnecessary database calls, or other operations
that count towards the resource quota.
applications in full trust is the easiest way to build powerful applications but
requires that you and your administrators are in total control of the code that
is being deployed. You and your power users can use Sandboxed solutions to
deploy applications. This makes sure that your SharePoint farm always is safe
and your applications are monitored.