Posts

Showing posts from March, 2015

Understand tiered architecture in SharePoint - C#

In this post we will learn to implement tiered architecture in a CSharp application. tiered architecture is a very famous and well known buzzword in the world of software development.  Basic Layers Presentation Layer Data Access Layer  Entity Layer  Code for Entity Layer   public class ITDRITCoordinatorsEntity     {         public int ID { get; set; }         public string Title { get; set; }         public SPFieldUserValueCollection Users { get; set; }         public ITDRITCoordinatorsEntity() { }         public ITDRITCoordinatorsEntity(int ID, string Title, SPFieldUserValueCollection Users)          {             this.ID = ID;             this.Title = Title;             thi...

Write an EventLog C# - SharePoint

# Create a new class called  Logger using System.Diagnostics;     public class Logger     {         string sSource;         string sLog;         public void EventLogWriter(string message)         {             SPSecurity.RunWithElevatedPrivileges(delegate()             {                 sSource = "SBS | Credit Approval";                 sLog = "Application";             if (!EventLog.SourceExists(sSource))               ...

How to Reset the List Item ID

Image
How to Reset the List Item ID value numbering at 1 One of the most common problems we in SharePoint lists , there  is no direct way , the value of the ListItem ID reset. In development  environment we used to insert and delete a lot of records and during this time  ID value automatically increases as the ID column is an up counter type.  Finally , when we move to staging and production environments, the website with  backup and restore the ListItem -ID value will not start with 1 . One way of preventing this problem is update the content Database ListID value to 1 Get The specific content database Name Go To the Central Admin Application Management Click on Manage Content Database            Select the specific web Application Database Name will be shown Get The specific List ID (GUID) Method A 1.        Navigate to the list and click  ...