Virtual Labs for SharePoint 2010

Jun 28 2010 Published by Shoban under MOSS 2010

Unlike other development technologies SharePoint development may be a costly affair. We need a Windows Server OS if we are developing for MOSS 2007.

Things are getting better with SharePoint 2010 and you can install MOSS 2010 in a Windows 7 pc and start developing apps but what if you don’t have a good build or required software?

Virtual labs for SharePoint 2010 are here.  You can test drive SharePoint 2010 without any instalation.

Virtual labs for Developers cover the following

  1. MSDN Virtual Lab: Client Object Model
  2. MSDN Virtual Lab: Customizing MySites
  3. MSDN Virtual Lab: Designing Lists and Schemas
  4. MSDN Virtual Lab: Developing a BCS External Content Type with Visual Studio 2010
  5. MSDN Virtual Lab: Developing a Sandboxed Solution with Web Parts
  6. MSDN Virtual Lab: Developing a Visual Web Part in Visual Studio 2010
  7. MSDN Virtual Lab: Developing Business Intelligence Applications
  8. MSDN Virtual Lab: Enterprise Content Management
  9. MSDN Virtual Lab: Getting Started with SharePoint 2010
  10. MSDN Virtual Lab: LINQ to SharePoint 2010
  11. MSDN Virtual Lab: SharePoint 2010 User Interface Advancements
  12. MSDN Virtual Lab: Visual Studio SharePoint Tools
  13. MSDN Virtual Lab: WorkflowMSDN Virtual Lab: Workflow

IT Pro labs are available in TechNet.

One response so far

3 ways to edit SharePoint page properties

May 19 2010 Published by Hojo Clement under MOSS 2007, PowerShell, Tips

Here comes another post in the series of “3 ways to do….”. Here is how you can edit the properties of a page in Sharepoint

using browser

1. Go to the pages library of the site.
2. Click Checkout menu of the page
3. Click property menu of the page
4. Edit property and save
5. Finally checkin that page
using Object model

SPSite site = new SPSite("http://mysite");
SPWeb web = site.OpenWeb();
SPFile file = web.GetFile("./pages/default.aspx");
file.CheckOut();
file.Item["Title"] = "new title";
file.Item.Update();
file.CheckIn("title edited");

using PowerShell

[system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
$site= New-Object Microsoft.SharePoint.SPSite ("http://mysite")
$web=$site.OpenWeb()
$page =  $web.GetFile("./Pages/default.aspx")
$page.CheckOut()
$page.Item["Title"] = "new title"
$page.item.update()
$page.CheckIn("title edited")

No responses yet

3 ways for adding new column in SharePoint list

May 12 2010 Published by Hojo Clement under MOSS 2007, MOSS 2010, PowerShell, Tips

In this post we will see 3 different methods for adding columns in SharePoint list or document library or discussion board.

using browser
Go to the list which you want to add column
On the page that displays the list, click list’s settings and create columns.
Type a name for the column, choose the column type and click OK.

using Object model


SPSite site = new SPSite(siteUrl);
SPWeb web = site.OpenWeb();

site.AllowUnsafeUpdates = true;
web.AllowUnsafeUpdates = true;

SPList list = web.Lists["mylist"];
SPFieldText fldName = (SPFieldText)list.Fields.CreateNewField(SPFieldType.Text.ToString(), "mycolumn");
fldName.Required = true;
fldName.MaxLength = 50;
list.Fields.Add(fldName);
list.Update();

site.AllowUnsafeUpdates = false;
web.AllowUnsafeUpdates = false;

using PowerShell


[system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
$site= New-Object Microsoft.SharePoint.SPSite ("http://mysite")
$web=$site.OpenWeb()
$list=$web.Lists["mylist"]
$list.Fields.Add("mycolumn", "Text", 0)

No responses yet

3 ways to find SharePoint list field’s Internal name

May 11 2010 Published by Hojo Clement under MOSS 2007, PowerShell, Tips

While working with caml query there may be cases where we may need to refer internal name of a sharepoint list and in some of the cases the display name and internal name may be different. If you try to access this list we will get object not found error.

We can find out the sharepoint field’s internal name using any of the following ways
1. Using browser (it applies to custom fields only)
Go to list settings -> Edit column. Then you can see field name from the query string

2. Object model (it applies for custom fields as well as system fields)

string siteUrl = "http://mysite";
SPSite site = new SPSite(siteUrl);
SPWeb web = site.OpenWeb();
SPList list = web.Lists["my forum"];
for (int i = 0; i < list.Fields.Count; i++)
Console.WriteLine(list.Fields[i].Title + "..." + list.Fields[i].InternalName + "...");
Console.ReadLine();

3. Powershell (it applies for custom fields as well as system fields)

[system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
$site= New-Object Microsoft.SharePoint.SPSite ("http://mysite")
$web=$site.OpenWeb()
$list=$web.Lists["my forum"]
$list.Fields |select title, internalname| more

One response so far