Hi I m trying to create a content database programatically but getting the error "Object reference not set to an instance of an object."
any help would be highly appriciated....
Thanks in Advance.....
View Complete Post
Learn how to build applications and plug-ins that interoperate with data from OneNote 2007 and 2010 using the OneNote Object Model library freely available on CodePlex. Andy Gray demonstrates how easy it is to integrate information from OneNote notebooks, sections and pages into smart client and Web apps.
MSDN Magazine July 2010
public partial class Test2 : System.Web.UI.Page
string nameDB = "CNB";
protected void Page_Load(object sender, EventArgs e)
protected void Button1_Click(object sender, EventArgs e)
Uri WebAppUri = new Uri("http://amit:5003");
SPWebApplication webApplication = SPWebApplication.Lookup(WebAppUri);
SPContentDatabaseCollection contentDBs = webApplication.ContentDatabases;
foreach (SPContentDatabase contentDB in contentDBs)
if (contentDB.Status == SPObjectStatus.Online)
contentDB.Status = SPObjectStatus.Disabled;
//SPSite siteCollection = webApplication.Sites.Add();
private void CreateContentDatabase(string suffix)
Windows Script Host (WSH) 5.6, a major upgrade for the WSH environment, provides some significant improvements over previous versions. A brand new security model that is tightly integrated with security in Windows XP allows administrators to place fine-grained restrictions on scripts reducing the risk from malicious code. In addition, local scripts can now run on remote machines, and enhancements to the object model reduce the amount of boilerplate code needed when writing professional code. This overview of WSH 5.6 explains these changes and how .NET and scripting work together.
MSDN Magazine May 2002
Microsoft Management Console (MMC) 2.0 provides a host of exciting new features for MMC users and snap-in developers. The new MMC 2.0 automation object model allows much of the user interface of MMC 2.0 to be accessed through script, and exposes events so that many tasks can now easily be automated. The new view extension model uses HTML to enable extensions to seamlessly integrate new user interfaces with those of existing snap-ins. MMC 2.0 also includes a specific view extension snap-in, the Extended View snap-in, which provides an interface similar to Web folders. Drag and drop support has been expanded, and console files now use the XML file format. Enhancements to console taskpads make it easier to accomplish tasks.
MSDN Magazine March 2001
MSDN Magazine November 2000