Friday, February 18, 2011

SharePoint 2010 Developer Dashboard

This will allows the developer to detect the critical modules, web parts and queries in the hosted SharePoint applications.
It lets the developer to analyses the each request and response’s time and each method’s responding time.
So the developer can easily locate the errors and resolve them.

To Activate this feature through stsadm tool

Stsadm -o setproperty -pn developer-dashboard -pv on

after these command you will get "Operation Successful" message.


To Deactivate
Stsadm -o setproperty -pn developer-dashboard -pv off

Thursday, January 27, 2011

C# - New line constant

String AccountName = "DomainNAme\\" + TextBox1.Text.ToString() + "." + TextBox2.Text.ToString();

Monday, January 17, 2011

SPListItem updating programmatically

After multiple attempts of opening the site using SPSite class,I could not make it happen.But searching of these topics i learned many tips and idea to resolve my task.
My requirement was having on webpart there I must create the Form to be filled by end user.These will be inserted into SharePoint List.
In Visual webpart I used the below code
 SPSite site = SPContext.Current.Site;
               SPWeb web = site.OpenWeb();
                SPList myList = web.Lists["List OF Employee"];
                SPListItem Item = myList.Items.Add();
                Item["Title"] = TextBox1.Text;
                Item["Name"] = TextBox2.Text;
                Item.Update();

Wednesday, December 22, 2010

Linq to class objects

This example shows how to use the array of class object and its variables on run time using "LINQ".
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public class LinqClass
{
    public string Name;
    public string contact;
    public string city;

}

using System.Xml;
using System.Xml.Linq;
using System.Linq;
using System.Data;

var sp = new[] {
          new LinqClass { Name="Murugesan",
                          contact="9769104815",
                          city="Chennai"
                        },
                        new LinqClass { Name="Pandian",
                                        city="Madurai",
                                        contact="9786466642"
                                      }
          };
        foreach (var n in sp)
        { 
            Response.Write(n.Name.ToString());
        }