Wednesday, 4 December 2013

Insert,update,delete in sharepoint list using Javascript

<input type="button" value="Submit"  onclick="createListItem();" style="width: 89px" /> <input type="button" value="Update"  onclick="updateListItem();" style="width: 89px" /> <input type="button" value="Delete"  onclick="deleteListItem();" style="width: 89px" /> <script type="text/javascript">     var siteUrl = '/sites/TeamSite1';     function createListItem() {  ...
Continue Reading...

Delete all SharePoint List Item using Powershell in SharePoint

Sytax:- $SITEURL = "http://serverurl" $site = new-object Microsoft.SharePoint.SPSite ( $SITEURL ) $web = $site.OpenWeb() "Web is : " + $web.Title $oList = $web.Lists["LIST NAME"]; "List is :" + $oList.Title + " with item count " + $oList.ItemCount $collListItems = $oList.Items; $count = $collListItems.Count - 1 for($intIndex = $count; $intIndex -gt -1; $intIndex--) {         "Deleting record: " + $intIndex  ...
Continue Reading...

Tuesday, 3 December 2013

join two sharepoint list using c#

1.Create a custom list name as "List1" with below column 2.Create a custom list name as "List2" with below column 3.paste the below code inside the webpart public void GetEmployee()         {             SPWeb objweb = SPContext.Current.Web;          ...
Continue Reading...

Timer Job Example in SharePoint 2013

1.open visual studio 2012 2.Add SharePoint2013-Empty Project named it "TimerJobExample" 3.Enter your site collection and choose Deploy as a Farm solution 4.Add class file in your solution named it "Employee" 5.paste the below code inside the Employee class  public class Employee : SPJobDefinition     {      ...
Continue Reading...

Create sharepoint list custom form via visual studio 2012

1.open visual studio 2012 2.Add Sharepoint 2013 Empty project Named it "Employee" 3.Create a custom list name as "Employee" and add the below columns 4.Right click the project add the layouts folder inside that add one Application page named it "EmpCustomForm" 5.Paste the below code inside the Content ID "Main"    ...
Continue Reading...

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...

Followers

Follow The Author