Say you have a Reporting Services web part, and you want to change an indicator on the report from red to green with a single click. To do this, without relying on SharePoint Server Admins, build a Visual Studio 2010 C# Express Console Application following the Client Object Model.

The following Program.cs, for example, uses the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime dll’s to open the SharePoint site and find the External List by name.

using System;
using Microsoft.SharePoint.Client;

class Program
public static void Main()

String siteUrl = "http://whatever/whatever";

ClientContext clientContext = new ClientContext(siteUrl);

List list = clientContext.Web.Lists
.GetByTitle("name of external list");
CamlQuery camlQuery = new CamlQuery();

// RowLimit will have no effect
camlQuery.ViewXml =

It uses this XML section to return all empty fields in a column of SQL origin with a string datatype called “CopyOfBdcIdentity.”

				<FieldRef Name='CopyOfBdcIdentity' />
			<FieldRef Name='Group'/>
		<FieldRef Name='ID'/><FieldRef Name='Title'/>
		<FieldRef Name='BdcIdentity'/>
		<FieldRef Name='CopyOfBdcIdentity'/>

It then loops through the results, copies the BDC Identity value as a string to the CopyOfBdcIdentity in each item, and reports on the results.

// include referenced field here as well
ListItemCollection listItems = list.GetItems(camlQuery);

	items => items
		item => item["ID"],
		item => item["Title"],
		item => item["BdcIdentity"],
		item => item["CopyOfBdcIdentity"]


// loop through the result
foreach (ListItem listItem in listItems)
	listItem["CopyOfBdcIdentity"] = listItem["BdcIdentity"].ToString();

	// update all fields

	// display the result
	Console.WriteLine("SpreadKey: '{0}', Group: '{1}'",

// invoke ExecuteQuery a second time

Console.Write("Update complete, press Enter to continue!");

When done, compile and deploy code as an EXE file to a shared server location, and run it from a Windows desktop shortcut.