# Wednesday, February 24, 2010

If you have already begun installing the SharePoint Server 2010 Beta on Microsoft Windows Server 2008 R2 you may have already encountered the following error when provisioning Service Applications or when accessing pages that make service calls:

Exception details:
System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'allowInsecureTransport'. Note that attribute names are case-sensitive

To resolve this issue you will need to download the KB976462 hotfix which can be found at

http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806.

posted on Wednesday, February 24, 2010 2:15:37 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] Trackback

I have written a PowerShell script that creates item on your custom list.

You can download and review the script via this link

http://gallery.technet.microsoft.com/ScriptCenter/en-us/610b0187-e31d-4693-a0c0-0d453be44cc0

posted on Wednesday, February 24, 2010 9:14:05 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback

I have written a PoweShell script that creates a list from Custom List template and creates a field on it.

You can download and review the script via this link

http://gallery.technet.microsoft.com/ScriptCenter/en-us/cb59ada4-3df1-495a-85f7-272259815360

posted on Wednesday, February 24, 2010 9:12:34 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Tuesday, February 23, 2010

I write a script that deletes site collections on your web application and publish it via Microsoft Technet Script Repository.

You can download and review it via this link

http://gallery.technet.microsoft.com/ScriptCenter/en-us/8b77bb3d-de1b-41ba-9f82-8384279c0062

posted on Tuesday, February 23, 2010 2:27:05 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback

I write a PowerShell script and publish it via Microsoft Technet Script Repository.

You can download and review it via this link.

http://gallery.technet.microsoft.com/ScriptCenter/en-us/ab568ebe-7573-4c8c-beaa-8226a53f7355

posted on Tuesday, February 23, 2010 2:14:43 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
protected void Page_Load(object sender, EventArgs e)
{

   StringBuilder strContent = new StringBuilder();

   try
   {
      using(EntitiesDataContext context = new EntitiesDataContext("http://sharepoint/Development"))
      {
         var q = from companie in context.Companies
                 select new
                 {
                    companie.Title
                 };

         strContent.Append("<table border=\"1\" cellpadding=\"3\" cellspacing=\"3\">");

         foreach (var companie in q)
         {
            strContent.Append("<tr><td>" + companie.Title + "</td></tr>");
         }

         strContent.Append("</table>");
      }
   }

   catch (Exception ex)
   {
      strContent.Append(ex.ToString());
   }

   mainDiv.InnerHtml = strContent.ToString();
}
You must create Entities.cs with SPMetal Utility. You can download sample project
LINQVisualWebPartSample.zip (124,08 KB)
posted on Tuesday, February 23, 2010 12:55:38 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Monday, February 22, 2010

In this sample you will create a Windows Application for retrieving Sharepoint lists. Step by step instructions :

  • Add a reference to the Client Object Model. You can find Microsoft.Sharepoint.Client.dll ve Microsoft.Sharepoint.Client.Runtime.dll in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI folder.
  • Drag a TextBox control onto Form1.
  • Drag a ListBox control onto Form1.
  • Drag a Button control onto Form1.
  • Add using statement to your project cs file

    using ClientOM = Microsoft.Sharepoint.Client;
  • Enter the following code in the button1_Click event to retrieve data.

    private void button1_Click(object sender, EventArgs e)
    {
        this.Cursor = Cursors.WaitCursor;
        listBox1.Items.Clear();
    
        using (ClientOM.ClientContext ctx = 
    new ClientOM.ClientContext(textBox1.Text))
        {
            ClientOM.Web site = ctx.Web;
            ctx.Load(site);
            ctx.Load(site.Lists);
            ctx.Load(site,
                x => x.Lists.Where(l => l.Title != null));
            ctx.ExecuteQuery();
            foreach (ClientOM.List list in site.Lists)
            {
                listBox1.Items.Add(list.Title);
            }
        }
        this.Cursor = Cursors.Default;
    }

Result :

posted on Monday, February 22, 2010 12:58:14 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback

If you type SPSecurity, Visual Studio 2010's intellisense does not recognize it as a valid object, but once you type the entire line out, Visual Studio won't add the red underlined squiggle line indicating a syntax error. This is because when creating sandboxed solutions, you are still building against the full Sharepoint Object Model, but Visual Studio uses a different intellisense file to help the developer know which objects they will not have access to when the component runs in the sandboz.

Your sandboxed solution cannot include a reference to the SPSecurity type. If you use similar to following syntax

SPSecurity.RunWithElevated Priviliges(delegate
{
   //Your Code
});

You show the error like

posted on Monday, February 22, 2010 12:02:16 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback

Before you can deploy sandboxed solutions to the Sharepoint Server, your server must be configured for this. To configure, open Sharepoint 2010 Central Administration site and choose System Settings > Services on Server. Locate Microsoft Sharepoint Foundation User Code Service and check its status. If it's stopped, click the start hyperlink.

Now, web can create our first sandboxed solution.

Step by step instructions :

  • Open Visual Studio 2010 and choose to create a new project. Pick Empty Project under Visual C# > Sharepoint > 2010 template group.
  • Name your project as "SandboxedWebPart"


  • Choose your debugging site URL and check "Deploy as a sandboxed solution".
  • In Visual Studio 2010 Solution Explorer right click the solution name and select Add > New Item. Add a Web Part to your project.
  • Expand features, right click Feature1 and choose View Designer. In the designer, verify the Scope. It should be set to site.


  • In WebPart1.cs, add the following code in CreateChildControls method

    protected override void CreateChildControls()
    {
        Label message = new Label();
        Controls.Add(message);
    
        Controls.Add(new WebControl(HtmlTextWriterTag.Br));
    
        Button testButton1 = new Button();
        testButton1.Text = "Test 1";
        testButton1.Click += delegate
        {
            message.Text = String.Format("This site contains {0} lists",
                SPContext.Current.Web.Lists.Count);
        };
        Controls.Add(testButton1);
    }
  • Then deploy it. (Right click solution name and select "Deploy")
  • To show your web part, open your browser and navigate to the site. On the ribbon, select Page tab and choose Edit Page. Select a web part zone and add your web part.
posted on Monday, February 22, 2010 11:46:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Thursday, February 18, 2010

You can donwload public virtual machine which containes beta versions of Microsoft Office Server 2010 family products. Virtual machine configuration is :

  • Windows Server 2008 SP2 Standard Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS
  • Microsoft SQL Server 2008 SP1 + CU2 Enterprise Edition with Analysis, Notification, and Reporting Services 
  • Microsoft Office Communication Server 2007 R2 
  • Visual Studio 2010 Beta 2 Ultimate Edition 
  • Microsoft SharePoint Server 2010 Enterprise Edition Beta 2 
  • Microsoft Office Web Applications Beta 2 
  • FAST Search for SharePoint 2010 Beta 2 
  • Microsoft Project Server 2010 Beta 2 
  • Microsoft Office 2010 Beta 2 
  • Microsoft Office Communicator 2007 R2 Virtual machine

Download : http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&displaylang=en

posted on Thursday, February 18, 2010 12:22:11 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback