A host header is a third piece of information that you can use in addition to the IP address and port number to uniquely identify a Web domain or, as Microsoft calls it, an application server.
In SharePoint 2010, You can apply host headers at two different levels :
The following code snippet programmatically creates the host-named site collection with the URL http://training.sharepoint.com in the SharePoint Server 2010 Web application with the URL http://sharepoint
http://training.sharepoint.com
http://sharepoint
SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://sharepoint"));SPSiteCollection sites = webApp.Sites;SPSite Site = sites.Add(“http://training.sharepoint.com”, "Training","Training Site", 1025, "STS#0", "domain\ayman","Ayman El-Hattab", “ayman@aymanelhattab.com”, "domain\marwan”,"Marwan Tarek", "marwan@marwantarek.net", true);
You can also use PowerShell to achieve the same results, for more info refer to : http://technet.microsoft.com/en-us/library/cc424952.aspx
Hi,
I want to create a new site collection named " training.sharepoint.com/.../IT"
Kindly guide how to acheiev this via c# code.
Hi Ayman, I am trying to create content database through C#. Kindly tell which class to use create content database. Regards, Gaurav