Programmatically Retrieve List of Document Libraries

The following code snippet is used to retrieve the list of document libraries.

SPWeb _web = SPContext.Current.Web;

SPListCollection ListColl = _web.Lists;

foreach (SPList _lst in ListColl)

{

if (_lst.BaseTemplate == SPListTemplateType.DocumentLibrary)

November 26th, 2009 | टैग: , , | श्रेणी: काई 2007, SharePoint ऑब्जेक्ट मॉडल | एक टिप्पणी छोड़ दो

How to Use Resource File in SharePoint 2007

Create Resource file using Visual Studio IDE

Copy the resource file into 12 hive resource folder

GetLocalized method from SPUtility to read the values from resource file

वाक्य-विन्यास:

SPUtility.GetLocalizedString(“$Resources:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, lang);

उदाहरण:

SPUtility.GetLocalizedString(“$Resources:MyResources,FirstName”, “MyResources”, lang);

Sample Source:

November 8th, 2009 | टैग: , , | श्रेणी: काई 2007, SharePoint ऑब्जेक्ट मॉडल | एक टिप्पणी

Programmatically Read Alerts for Users in Site Collection

SPAlerCollection class can be used to get the Alert Collection for the User.

The below code snippet is used to read all alerts registered for the site collection users.

private static void GetAlerts()

{

SPSite currSite = new SPSite(“http://उदय”);

SPWeb currWeb = currSite.OpenWeb();

SPUserCollection […]

How to set the Interval for Alerts in SharePoint 2007

To set the timer job interval for alerts can set by using the setproperty for the property job-immediate-alerts command in stsadm.

वाक्य-विन्यास:STSADM -o getproperty -pn job-immediate-alerts –pv <property value> -url <साइट का URL>

उदाहरण:STSADM -o getproperty -pn job-immediate-alerts –pv “every 2 minutes” -url http://उदय

[…]

SharePoint में फोरम लाइब्रेरी प्रोग्राम में InfoPath एक्सएमएल फाइल को संपादित करने के लिए कैसे 2007

The below lines of code snippet is to update the infopath xml record(file)

SPWeb _web = SPContext.Current.Web; SPList _list = _web.Lists[“SampleFormLib”];

MemoryStream myInStream = new MemoryStream(item.File.OpenBinary()); XmlTextReader reader = new XmlTextReader(myInStream);

XmlDocument doc = new XmlDocument(); doc.Load(reader);

reader.Close(); myInStream.Close();

XmlNamespaceManager nameSpaceManager = new XmlNamespaceManager(doc.NameTable); nameSpaceManager.AddNamespace(“my”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);

doc.DocumentElement.SelectSingleNode(“my:Status”, nameSpaceManager).InnerText = “Saved”; […]

अलर्ट के लिए टाइमर कार्य अंतराल जाओ

प्राप्त करने के लिए अलर्ट के लिए टाइमर कार्य अंतराल stsadm में getProperty कमांड के प्रयोग के द्वारा प्राप्त किया जा सकता है.

वाक्य-विन्यास:Stsadm -o getProperty -pn कार्य तत्काल-अलर्ट -url <साइट का URL>

उदाहरण:

Stsadm -o getProperty -pn कार्य तत्काल-अलर्ट -url HTTP://उदय

SharePoint में नए आइकन संकेतक के लिए निर्धारित अवधि

SharePoint में नई आइकन के लिए अवधि निर्धारित करने के लिए (नए आइटम के बगल से पता चलता है जो सूचक) access the SharePoint WebApplication object and set the value for DaysToShowNewIndicator.

SPWebApplication WebApp = SPWebApplication.Lookup(new Uri(WebAppURL.Text));

WebApp.DaysToShowNewIndicator = 3;

WebApp.Update();

[…]

SPDisposeCheck Released!

SPDisposeCheck v1.3.1 has been released on MSDN Code Gallery, http://code.msdn.microsoft.com/SPDisposeCheck. This tool will help improve the quality of your SharePoint assemblies. It will inspect your SharePoint assemblies and check that you are correctly disposing of certain SharePoint objects (IDisposable objects which includes SPSite and SPWeb). The tool is based upon the guidance published in this […]

प्रोग्राम SharePoint में अद्यतन सूची सामग्री

हाय Devs,

The Below is the Sample Code to update the Sharepoint list content programmatically by using SharePoint Object Model.

SPSite Site = new SPSite(“http://लोकलहोस्ट:21000”); SPWeb Web = Site.OpenWeb(); SPList List = Web.Lists[“Address Book”]; SPListItem ListItem = List.GetItemById(0);

string FullName = string.Empty;

FullName = ListItem[“FirstName”].ToString() + ListItem[“LastName”].ToString(); SPListItem[“FullName”] = FullName; ListItem.Update();