Friday, 29 November 2013

Programmatically Create Subsite in SharePoint using c#

 private void CreateSubSites(string parentSiteURL, string siteURLRequested, string siteTitle, string siteTemplateName)         {             const Int32 LOCALE_ID_ENGLISH = 1033;             string newSiteURL = string.Empty;             SPSecurity.RunWithElevatedPrivileges(delegate()        ...
Continue Reading...

programmatically reterive item from sharepointlist using caml query in sharepoint

            SPSite mySite = new SPSite(SPContext.Current.Site.ID);             SPWeb myWeb = mySite.OpenWeb();             SPList myList = myWeb.Lists["ListName"];             SPQuery query = new SPQuery();             string CurrentDate = DateTime.Now.ToString("yyyy-MM-dd");  ...
Continue Reading...

get last list item id in sharepoint list using c#

            SPSite oSPsite = new SPSite(SPContext.Current.Site.ID);             SPWeb oSPWeb = oSPsite.OpenWeb();             SPList list = oSPWeb.Lists["ListName"];              SPQuery query = new SPQuery();                     query.RowLimit = 1;  ...
Continue Reading...

Programmaticaly Add user in sharepoint list using c#

           SPSite oSPsite = new SPSite(SPContext.Current.Site.ID);             SPWeb oSPWeb = oSPsite.OpenWeb();             SPList list = oSPWeb.Lists["user"];             SPListItem oSPListItem = list.Items.Add();             SPFieldUserValueCollection userCollection = new SPFieldUserValueCollection();  ...
Continue Reading...

Programmaticaly Add multi user in sharepoint list using c#

 DataTable table = new DataTable();             table.Columns.Add("Title", typeof(string));             table.Columns.Add("UserName", typeof(string));             table.Rows.Add( "Mohamedsithik","User1");             table.Rows.Add("Raja", "User2");             table.Rows.Add("Uthaya",...
Continue Reading...

Wednesday, 27 November 2013

Programmatically get people picker value from sharepoint list using C#

                    string users = string.Empty; SPFieldUserValueCollection userCol = new SPFieldUserValueCollection(SPContext.Current.Web, listItem["SiteOwner"].ToString()); foreach (SPFieldUserValue usrItm in userCol)   {   users += usrItm.User.ToString() + ",";   }    this.spPeoplePicker.CommaSeparatedAccounts = users.Remove(users.LastIndexOf(","),...
Continue Reading...

programmatically upload document library file in SharePoint 2013 with meta data using c#

string fileNameonly = Fileupload1.FileName;  // Only file name.  private byte[] ToByteArray(Stream inputStream)         {             using (MemoryStream ms = new MemoryStream())             {                 inputStream.CopyTo(ms);                 return...
Continue Reading...

Thursday, 21 November 2013

sharepoint custom attachement upload control with example

                        sharepoint custom attachement upload control with example  Design Code:- <table> <tr><td> <asp:HiddenField Value="hDeleteAttachs" ID="hHiddenFields" runat="server" /> </td></tr> <tr> <td><span id="part1"> <SharePoint:AttachmentButton...
Continue Reading...

Select Insert update delete SharePoint custom list data using CSOM C# Example

public class EmpInfo         {             public EmpInfo(string Name, string Age)             {                 _Name = Name;                ...
Continue Reading...

the remote server returned an error 401 unauthorized sharepoint client object model

Solution:- NetworkCredential credentials = new NetworkCredential("username", "pwd", "domain"); ClientContext context = new ClientContext("http://site-url"); context.Credentials = credentials; ...
Continue Reading...

Tuesday, 19 November 2013

visual studio 2012 sharepoint 2013 templates missing

Solution:- Check the below url   http://www.sharepoint24x7.com/2013/03/18/articlehow-to-enable-sharepoint-2013-development-project-templates-in-visual-studio-2012/ ...
Continue Reading...

Excel data to DataTable using c#

  DataTable dt = new DataTable();             string line = null;             int i = 0;             using (StreamReader sr = File.OpenText(@"E:\Sample.csv"))             {                ...
Continue Reading...

SharePoint 2013 Content Deployment Source feature

SharePoint 2013 Content Deployment Source feature Site settings Site Collection Features  Content Deployment Source Feature ----->  Activate features site settings Site Collection Administration section click Content Deployment Source Status ...
Continue Reading...

An object of the type Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool named

                                            Sorry, something went wrong An unhandled exception occurred in the user interface.Exception Information: An object of the type Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool...
Continue Reading...

programmatically Insert,update,delete in sharepoint list using c#

Add New Item :-                    public void AddNewItem()         {             SPSecurity.RunWithElevatedPrivileges(delegate             {                ...
Continue Reading...

we are having a problem opening this location in file explorer sharepoint 2013

Solution:-             Just add the Desktop Experience Refer the below link http://www.win2012workstation.com/desktop-experience/ ...
Continue Reading...

open with explorer sharepoint disabled

Solution:- Just open the same Document in Internet Explorer(IE) ...
Continue Reading...

sign in different user missing in sharepoint 2013

1.Just open the following fileC:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx2.Add the below line inside the file<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"  Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"   Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"   MenuGroupId="100"  ...
Continue Reading...

Rename ContentDataBaseName in SharePoint Using SQLQuery

Alter ContentDb Name USE MASTER;GOALTER DATABASE [WSS_Content_fdc3317e5897456ab294ef998ec46420]SET SINGLE_USER WITH ROLLBACK IMMEDIATEGOALTER DATABASE [WSS_Content_fdc3317e5897456ab294ef998ec46420]MODIFY NAME= WSS_Content4;GOALTER DATABASE WSS_Content4SET MULTI_USERG...
Continue Reading...

Delete SharePoint Content DataBase using PowerShell

Syntax:-Remove-SPWebApplication http://sitename -Confirm -DeleteIISSite -RemoveContentDatabasesExample:-Remove-SPWebApplication http://abcd01:1111/ -Confirm -DeleteIISSite -RemoveContentDatabas...
Continue Reading...

move site collection from one web application to another web application using powershell

Example Script:-#Get the from Site Collection URL$fromURL = "http://Abcd:5000/sites/Fromsite"#Get the to Site Collection URL $toURL = "http://sfs01:4000/sites/Rsite3/"#Location to the backup file directory to store Site Collection backup files$backupPath = "C:\\SiteBK.bak"#Backing up Site Collection prior to movingWrite-Host "Backing Up Site Collection…."Backup-SPSite $fromURL -Path C:\SiteBK.bak -force#Removing Site Collection...
Continue Reading...

Followers

Follow The Author