Retrieving Values from Configuration Database Sharepoint

This example is a console application for Retrieving Values from the Configuration Database.

using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace GetConfigDatabase
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://SPSite"))
{
SPContentDatabase cb = site.ContentDatabase;

Console.WriteLine("Content Database: {0}", cb.DisplayName);
Console.WriteLine("Connection String: {0}",

cb.DatabaseConnectionString);
Console.WriteLine("Size: {0} Bytes", cb.DiskSizeRequired);

foreach (SPSite s in cb.Sites)
{
Console.WriteLine(" Sites: {0}", s.Url);
}
}
Console.ReadLine();
}}}

0 comments:

Post a Comment

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at sharepointprogrammingblogger@gmail.com .

Copyright (c) 2010 @ myshaepointwork.blogspot.com. All rights are reserved.Do Not Copy.

@ Learning SharePoint.com