June 2010

Create content database dynamically

SPWebApplication mywebApplication; Uri myWebAppUrl = new Uri(siteurl); myWebApplication = SPWebApplication.Lookup(myWebAppUrl); string databaseName = "WSS_Content_" + Guid.NewGuid().ToString(); myWebApplication.ContentDatabases.Add(databaseservername, databaseName, null, null, 1000, 10000, 0)