2.8. Introducing the Microsoft.SharePoint Namespace

Thankfully, Microsoft shipped a very extensive and robust API that enables developers to write custom code solutions to add, extend, and change functionality, as well as manage SharePoint. Keep in mind that the SharePoint API is the only supported way to access data within SharePoint. Never go directly to the SQL Server databases to make changes or select data — always use the SharePoint API. In addition, the SharePoint API is how the provided tools and interfaces interact with SharePoint, including the browser-based interface, the included Web services, and the command-line utility STSADM.EXE. Not only did Microsoft use the SharePoint API that ships with WSS 3.0 and MOSS 2007 for all the included administration interfaces, but there are additional things that the admin interfaces do not expose that developers can implement using the SharePoint API.

The core of the SharePoint API is the Microsoft.SharePoint namespace, which is found in the Microsoft.SharePoint.dll assembly located in [..]\12\ISAPI. All developer projects created in Visual Studio need to contain a reference to this assembly, as all other SharePoint assemblies are dependent upon the core Microsoft.SharePoint.dll assembly.

This chapter has already touched on some of the more important and common classes within the Microsoft.SharePoint namespace, such as SPSite for site collections and SPWeb for SharePoint sites. Additional classes found in the root of the Microsoft.SharePoint ...

Get Professional SharePoint® 2007 Web Content Management Development: Building Publishing Sites with Office SharePoint Server 2007 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.