Thursday, December 27, 2007

GROUPING SETS - New User defined data types in SQL Server 2008

Other cool features that developers and architects will love are sparse columns, GROUPING SETS, large user-defined data-types (that can exceed the 8000-byte limit), and the new FILESTREAM data type

A new member of the T-SQL Family - the MERGE statement

One revolutionary addition is the new MERGE statement. On par with other core T-SQL CRUD features such as INSERT, SELECT, UPDATE, and DELETE, the MERGE statement is an ISO-2003 compliant command that is primarily intended to handle what many database users refer to as "UPSERT" functionality. For example, say you have an application where you either need to log a new entry for something that hasn't been added to your system, or update it if it's already been added previously. Without the MERGE statement you must either run a SELECT statement to see if a row has already been logged and then UPDATE or INSERT if it's not there. Or you can try to UPDATE first, and then INSERT if the UPDATE doesn't affect any rows. With the MERGE statement you can do this all in one fell swoop. Here's a rather extensive example of the syntax, pulled from the SQL Server November CTP:

MERGE Production.ProductInventory AS pi
USING (SELECT ProductID, SUM(OrderQty) FROM Sales.SalesOrderDetail sod
JOIN Sales.SalesOrderHeader soh
ON sod.SalesOrderID = soh.SalesOrderID
AND soh.OrderDate = GETDATE()
GROUP BY ProductID) AS src (ProductID, OrderQty)
ON (pi.ProductID = src.ProductID)
WHEN MATCHED AND pi.Quantity - src.OrderQty <> 0
THEN UPDATE SET pi.Quantity = pi.Quantity - src.OrderQty
WHEN MATCHED AND pi.Quantity - src.OrderQty = 0

Documentation from a previous CTP's Books Online provides an overview, but the syntax has changed a bit between CTP releases. However, if you study that statement listed above, you can see that it's just a built-in switch (or case) that specifies what to check for, and then what to do if the data is found or not. What's cool about this statement, though, is that you can perform the entire check-in a single operation - which drastically increases performance during large-scale UPSERT operations or when you're trying to merge two large tables.

Table-Valued Parameters
Ever wanted - or more importantly - needed to pass in a table or array of values to your stored procedures? Well, now you can with Table-Valued Parameters. Imagine the following:
key varchar(6),
value varchar(20)

CREATE PROC dbo.InsertKeyValuesFromWebApp
@tvp myTable READONLY,
@owner int

INSERT INTO [dbo].[SomeTable] (key, value, owner)
SELECT key, value, @owner FROM @tvp


For simpler applications, this functionality might seem like overkill, but for many complex applications, having this code on hand will be a lifesaver. This is something I’ve wanted for years (and which I’ve had to get around by sending in XML fragments as varchar parameters and then re-hydrating on the server) , and now we’ll have native support for it – I can’t wait. I can also see this becoming a wicked bit of functionality when combined with LINQ down the road.

Tuesday, October 30, 2007

Saturday, October 06, 2007

Microsoft Codename "Astoria" CTP toolkit enables developers to create and consume Data Services for the Web

The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within corporate networks and across the internet. The data service is reachable over regular HTTP requests, and standard HTTP verbs such as GET, POST, PUT and DELETE are used to perform operations against the service. The payload format for the data exchanged with the service can be controlled by the client and all options are simple, open formats such as plan XML and JSON. The use of web-friendly technologies make it ideal as a data back-end for AJAX-style applications, Rich Interactive Applications and other applications that need to operate against data that is across the web.

Read More & Download....

Team System Web Access (formerly known as TeamPlain) released

Team System Web Access (formerly known as TeamPlain) is a Web interface to Visual Studio 2008 Team Foundation Server. The following features are available in the new release:
  1. NEW: Display custom controls on work item forms
  2. NEW: view queued builds new, queue new builds
  3. Add new work items or edit existing ones
  4. Work with any type of work item, including custom ones
  5. Add new work item queries or edit existing ones
  6. View, download, upload, check-in and check-out documents on SharePoint team portal
  7. View reports, export as PDF or Excel
  8. Browse source control repositories, download files, view changesets, diffs, histories, and annotated views
  9. View build results, start or stop builds
  10. Search for keywords in work items

DOWLOAD this awesome tool from Microsoft website today

Thursday, October 04, 2007

SharePoint Project Management: Better Handling of Multiple Project Sites (3rd Party Tool for MOSS)

SharePoint 2007 / MOSS 2007 Backup Pros and Cons, Evaluation Standards & Strategies (3rd Party tool for MOSS)

With SharePoint quickly becoming the preferred platform for team collaboration, protecting it against data loss and damages is a key concern for today’s administrators. Can you distinguish various types of data based on its importance? Can you backup critical, frequently changing sites and documents to separate storage tiers? Though improved, the native SharePoint 2007 backup tools still have major issues with recovery granularity, performance, fidelity, and usability. This webinar discusses MOSS 2007 backup Pros and Cons, and recommends new evaluation standards and practices for SharePoint backup.

AvePoint specializes in award winning, enterprise-strength backup solutions for MOSS 2007, WSS 3.0 and Project Server 2007. Today, with 700+ production customers (many of them Fortune 500 companies) and well over 2000 trial customers across 6 continents, AvePoint has become the dominant market leader in SharePoint staging, backup, and disaster recovery solutions.

Wednesday, October 03, 2007

eMail Management and Outlook Integration through nSynergy (3rd party tool for MOSS)

I came across a product from nSynergy that specializes in email and document management using SharePoint 2003/2007. They have developed Drag&DropIt™ to integrate SharePoint and Outlook and finally solve the problem of managing emails within SharePoint. Drag&DropIt™ allows you to easily save emails and email fields into SharePoint document libraries both online and offline. View this demonstration to find out more about dragging and dropping emails into SharePoint and accessing your SharePoint document libraries without ever leaving Outlook

Why is eMail Management so critical?

eMail management has become a high priority for all businesses, both large and small, with most written correspondence being delivered in email form. Businesses can use tools like SharePoint to manage most of their important business documents, but the inability to easily place emails into SharePoint and share those files within a document library is a problem that many SharePoint users have encountered.

You can now use Outlook to drag and drop emails directly into SharePoint document library folders. You can also view, open, create and access documents and emails directly within Outlook. With emails, documents and other files being accessible through Outlook, everyone in your workplace can use Outlook and SharePoint together to create a powerful yet simple document management tool.

The ability to automatically move emails from Outlook into SharePoint and create document library folders from Outlook is a process that will energize your SharePoint 2007 workflows.

nSynergy product that leverages the familiarity of the Outlook interface and the powerful searching features of SharePoint is needed. Metadata from emails such as Date Received, Date Sent, From and other fields are transferred automatically into a document library’s columns by simply dragging and dropping emails into Outlook folders. This makes it easier to filter and search for these emails and utilize the power of the SharePoint document library views.

Monday, October 01, 2007

How to index PDFs in MOSS 2007 document libraries

SharePoint document libraries are phenomenal tools for collaborative environments where files are shared. And SharePoint's ability to search files in document libraries makes finding files easy. Well, unless the document is a non-Microsoft file type, such as the ever-present PDF file.

The sad fact of the matter is that Windows SharePoint Services (WSS) 3.0 and Microsoft Office SharePoint Server (MOSS) 2007 can't index PDFs by default. That's not news to many veteran SharePoint professionals. Nor is the fact that you can add an icon for PDFs, reindex existing documents, and so forth. However, many administrators are new to SharePoint, and will hit their heads hard against this problem. I was disappointed to see that, despite extensive searching on Google, I could find no single, authoritative, and (most importantly) complete guide for how to do so.

The "bottom line" is that you must install an iFilter for PDFs on your SharePoint servers--specifically, any server that performs search, which would be all WSS servers and your MOSS search server. iFilters are plug-ins that enable indexing of file types. Although iFilter is a Microsoft specification, it is generally through vendors or third parties that you'll get iFilters--not through Microsoft itself.

After you add the iFilter, you must configure SharePoint to index the file type (.PDF). But then, you still have two problems. The biggest is that SharePoint will index only files that are added or existing files whose properties change. So SharePoint will not index existing PDFs when you add the PDF iFilter. You must rebuild your index. The second challenge, purely a cosmetic one, is that you enable SharePoint to display an appropriate icon for PDFs.

This installment will focus on 32-bit WSS servers. Both of these documents contain the word "iFilter" in them, but a search produces only the Word document. Now, let's fix the problem!

1. You will need two downloads: The Adobe PDF iFilter version 6.0, available from Adobe click here
An icon for PDFs, also available from Adobe. Check their licensing page then download the gif

2. Install the iFilter. Note: Many guides on the Internet suggest shutting down Microsoft IIS or the Shared Service Provider (SSP) or the WSS application(s). I found this was not necessary, and Microsoft's own KB article 927675 did not specify it was necessary.

3. Add a registry entry for the .pdf extension in the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Applications\\Gather\Search\Extensions\ExtensionList. (Open the registry editor. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Applications\\Gather\Search\Extensions\ExtensionList\. Identify the highest "number" value in the key. On a default installation of WSS, the highest entry is 37. Note they are not sorted in numeric order because registry value names are strings. Create a registry value for the next number, e.g. 38, by choosing Edit à New à String Value then naming the value the next highest number (e.g. 38). Double-click the value you just created and, in the Value Data box, type: pdf. Note there is no dot preceding the extension.

4. There are two registry keys with specific values that must exist. Verify that these exist and, if not, create them: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf - Value Name: Default; Type: REG_MULTI_SZ; Data: {4C904448-74A9-11D0-AF6E-00C04FD8DC02})
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\Filters\.pdf (Value Name: Default; Type: REG_SZ; Data: (value not set) - Value Name: Extension; Type: REG_SZ; Data: pdf
- Value Name: FileTypeBucket; Type: REG_DWORD; Data: 0x00000001 (1)
- Value Name: MimeTypes; Type: REG_SZ; Data: application/pdf

5. Restart the Windows SharePoint Services Search service. Open a command prompt. Type net stop spsearch, then net start spsearch. Perform a search, and existing PDFs will not be returned. But newly added PDFs will (once indexed by SharePoint) appear in search results. If you modify any property of an existing PDF, it will be indexed. But who wants to modify all existing PDFs in a document library? This is where I found a lot of misinformation online. Even Microsoft's KB 927675 didn't suggest the right solution! It's easy! STSADM, SharePoint's ubercommand, to the rescue!

6. Rebuild the WSS search index.- Open a command prompt.- Navigate to Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN and type the following commands
stsadm.exe -o spsearch -action fullcrawlstop
stsadm.exe -o spsearch -action fullcrawlstart
The existing PDFs will, after being indexed, appear in search results. But they will still not have correct icons. So, while your site is being indexed, keep going with these steps to configure the icon.

7. Open the folder Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images.

8. Copy the gif you downloaded in Step 1 into the folder.

9. Open the folder Program Files\Common Files\Microsoft Shared\Web server extensions\12\Template\Xml.

10. Right-click the file docicon.xml and choose Open With and select Notepad.

11. In the element, you'll see a number of elements. You will add one for pdf. It does not have to be in alphabetical order. The element you need to add is:

12. Save that file and close Notepad.Now, the moment of truth. A search now provides the results.

Microsoft is finally using Microsoft Team Foundation Server internally

Microsoft is finally using Microsoft Team Foundation Server 2008 Beta 2 internally. Click here to get some great statistics

Rich Internet application job trends and salaries

This is a good reference for all you interactive developers to know what you are worth in the marketplace

How to generate RSA public and private keys as well as export to XML

The following method shows how RSA keys can be saved to disk as an XML file. The XML files can then be used to make an RSA secure channel -- the public key is used for encryption and the private one for decryption.

/// Generates 2 XML files (public and private key)

/// RSA private key file path
/// RSA private key file path
/// secure size must be above 512
public static void GenerateRsa(string privateKeyPath, string publicKeyPath, int size)
//stream to save the keys
FileStream fs = null;
StreamWriter sw = null;
//create RSA provider
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(size);
//save private key
fs = new FileStream(privateKeyPath, FileMode.Create, FileAccess.Write);
sw = new StreamWriter(fs);
if (sw != null) sw.Close();
if (fs != null) fs.Close();
//save public key
fs = new FileStream(publicKeyPath, FileMode.Create, FileAccess.Write);
sw = new StreamWriter(fs);
if (sw != null) sw.Close();
if (fs != null) fs.Close();

Friday, August 24, 2007

Awesome article on Unit Testing

Visual Studio Team Foundation Server Web Access Power Tool

Team System Web Access (formerly known as TeamPlain) is a Web interface to Visual Studio 2005 Team Foundation Server. Download this awesome power tool now

Tuesday, July 24, 2007

My TOP 10 Coolest Visual Studio 2008 Features

Visual Studio 2008, due for release at the end of 2007, promises numerous improvements for Visual Basic, a data query called the Language Integrated Query (LINQ), a new Entity Framework for ADO.NET and updated tools for ASP.NET AJAX and Office 2007 development.
My top ten Visual Studio's IDE features are as follows:

1) Multi-targeting

Visual Studio 2008 is billed as the design surface for the .NET Framework 3.5, which itself is the merger of the .NET 3.0 toolset introduced earlier this year with updated versions of ASP.NET, ADO.NET, Visual Basic, C# and the CLR. At the same time, though, Orcas allows developers to work backwards and develop specifically for .NET 2.0 or 3.0. Once a framework version has been selected, Visual Studio 2008 will enable the reference features that are appropriate for that version of the framework. (In other words, don't try using LINQ in a .NET 2.0 application.)

2) N-tier application development

An n-tier application is spread among any number of different systems, typically a service layer, an access layer and a business logic layer. With such a model, it is easy to share validation logic between entities. Unfortunately, developing such applications in Visual Studio 2005 is pretty much impossible because a dataset and the code that connects it to a database are in the same file. The change in Visual Studio 2008 is subtle but important, as the table and the dataset now reside in different layers.

3) An improved designer

Visual Studio 2005 designer is a little more of the Internet Explorer renderer turned into an editor. To improve upon this, the Visual Studio group turned to Expression, the Microsoft product suite for Web designers. The new designer allows developers to apply styles in line, with an existing class, with a new class or with Internet Explorer. In addition, changes such as margins and paddings around images can be applied to rules and not just individually. This also makes for cleaner CSS files.Finally, the designer offers a split view, so developers can look at source code and design simultaneously. This is a response to the growing trend of development using two monitors.

4) ASP.NET AJAX and VSTO for Office 2007

Right now, developers aiming to build cutting edge Web applications have to download the ASP.NET AJAX framework, and those who want to develop for Office 2007 have to download Visual Studio 2005 Tools for Office Second Edition. Both ASP.NET AJAX and VSTO 2005 SE will be directly incorporated into Visual Studio 2008. VSTO will come with a new runtime, which will run both Office 2007 and Office 2003 add-ins, while ASP.NET AJAX will come with a variety of JavaScript tools, such as IntelliSense and robust debugging.

5) The ADO.NET Entity Framework

The biggest changes to ADO.NET revolve around its Entity Framework, which, unfortunately, is now slated to be released quite a while after Visual Studio 2008. This framework consists of a conceptual layer, which fits between an application's logical database layer and its object layer, and the Entity Data Model. Run the Entity Data Model Wizard in Visual Studio 2008 and the output is three files - a conceptual model that talks to object classes, a logical model that the relational database talks to, and map between the conceptual and logical models. Within the conceptual layer, one finds entity types bundled into sets, associations that define the relationship between entities, and sets of associations. The information in this layer will handle the back and forth with SQL Server without touching data access code. Once entities have been created, developers can use the either CreateQuery or new LINQ to Entities query to retrieve entity objects, data records or anonymous types.

6) LINQ: The Language Integrated Query

In Visual Studio 2005, querying a dataset typically involves a stored procedure, a newly created view and a bit of ADO.NET filtering. This is the case because data exists in rows, while .NET code deals with objects. They are always two different worlds and LINQ puts queries inside the languages and merges the worlds together.
At its most basic level, the Language Integrated Query, a feature of both Visual Basic and C#, uses the concept of the SQL Select statement to make its queries. However, there are two important differences:
(a) Firstly LINQ statements begin with a From statement instead of the Select statement. By listing the data source first, IntelliSense is triggered.
(b) Secondly, since C# is an object-oriented languages, whatever you can express in C# you can make part of LINQ queries. This encompasses anything that is IEnumerable - entities, collections and even XML. Moreover, since the queries are being made in an object-oriented environment, you can do very complex things that result in a completely different result set, such as calling up an instance of objects that did not exist in the source at all.
LINQ also brings about the introduction of several new language concepts for Visual Basic and C#. The expression tree, for example, is a data representation of the LINQ expression that bridges the gap between the .NET code and the SQL Server. In addition, property initialization makes it possible to create an object and set its properties in a single line of code.
Other new language concepts, which will be discussed below, include implicit types and extension methods.

7) Implicit types

Implicit types provide strong typing without forcing developers to figure out the type they need. The compiler does the work for them, since the type is inferred from the initializer expression. Implicit types work well when looping through a collection, since in such a scenario a developer is likely to be looking only for a key and a value and will not know, or care, what is the index type. In addition, inferring types makes it possible for extensions to bind to data types such as XML. This is fundamental to making LINQ work.

8) Extension Methods

Extension methods is a feature coming straight from LINQ, since all LINQ query operators are extension methods. These methods are marked with custom attributes and are then added to other objects automatically (so long as they are not already there). Extension methods can be used just about anywhere a developer would use a normal function. However, they cannot contain optional parameters, parameter arrays or generic arguments that have not been typed. Also, late binding cannot be done with extension methods.

9) IntelliSense

IntelliSense, already referred to as "Intellicrack" in some development circles, is set to encompass keywords, member variables and anything in scope. Moreover, IntelliSense will work with implicit types, once the compiler has figured out what is the type. In addition, LINQ is set up to take advantage of IntelliSense. In SQL syntax, the Select query comes first, but in LINQ, the From statement comes first. With the data source listed first, IntelliSense has a chance to kick in. Visual Studio 2008 has also added JavaScript IntelliSense to accommodate ASP.NET AJAX development.

10) Relaxed delegates, initializers and more

Check this MSDN article to learn more on relaxed delegates and initializers. The emphasis there is on productivity gains developers can expect to enjoy when building data-oriented applications with an increasingly dynamic language.

What is .NET 3.0?

A lot of people have asked me about what .NET 3.0 is and the features it ships. Here is my quick summary. .NET 3.0, formerly known as WinFX, is the latest version of Microsoft's .NET Framework, which represents both the company's business strategy and its collection of programming support for Web services. .NET 3.0 was released at the same time as Vista, Microsoft's update to its Windows operating system.

.NET 3.0 consists of four news tools. The Windows Communication Foundation lets developers build unified Web services and other distributed systems that can talk to each other. The Windows Presentation Foundation is a development tool for Web applications and rich client applications. The Windows Workflow Foundation is a programming model for building workflow-enabled applications in Windows. Finally, Windows CardSpace is an identity management component.

In addition to those four new tools, .NET 3.0 also includes several key existing pieces of .NET 2.0, such as ADO.NET 2.0, ASP.NET 2.0, Windows Forms 2.0 and the Common Language Runtime, or CLR 2.0. Microsoft's Expression suite, Windows File System and Visual Studio 2005 development suite are also compatible with .NET 3.0.

Wednesday, July 18, 2007

My TOP 18 Coolest Visual Studio Add-Ons

1) Microsoft Interop Forms Toolkit 2.0 - "This toolkit helps you bring the power of .NET to your existing VB6 applications, by allowing them to display .NET Forms and Controls from within the same application. Instead of upgrading the entire code base, these applications can now be extended one form at a time. The goal is a phased upgrade, with production releases at the end of each iteration containing both VB6 and VB.NET forms running in the same VB6 .exe process."

2) Application Verifier - "Application Verifier is a runtime verification tool for unmanaged code that assists in finding subtle programming errors that can be difficult to identify with normal application testing. Run the Application Verifier tests on your code to identify issues within heaps, handles, and locks."

3) ILMerge - "ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output."

4) XML Notepad 2007 - "XML Notepad 2007 provides a simple intuitive user interface for browsing and editing XML documents."

5) Internet Explorer Developer Toolbar - "The Microsoft Internet Explorer Developer Toolbar provides a variety of tools for quickly creating, understanding, and troubleshooting Web pages."

6) Team Foundation Power Tool - "The Microsoft Visual Studio 2005 Team Foundation Server Power Tool (formerly known as Power Toys) is a set of enhancements, tools and command line utilities that improve the Team Foundation Server experience."

7) ASP.NET AJAX 1.0 - "ASP.NET AJAX is a set of technologies to add AJAX (Asynchronous JavaScript And XML) support to ASP.NET. It consists of a client-side script framework, server controls, and more."

8) Enterprise Library 3.0 - "This release of Enterprise Library includes: Caching Application Block, Cryptography Application Block, Data Access Application Block, Exception Handling Application Block, Logging Application Block, Policy Injection Application Block, Security Application Block and Validation Application Block."

9) Windows PowerShell 1.0 - "Microsoft Windows PowerShell is a new command-line shell and scripting language designed for system administration and automation. Built on the .NET Framework, Windows PowerShell enables IT professionals and developers control and automate the administration of Windows and applications."

10) Microsoft ASP.NET Futures - "The Microsoft ASP.NET Futures May 2007 release contains an early developer preview of features providing a wide range of new functionality for both ASP.NET and Silverlight."

11) Reflector for .NET - "Reflector is the class browser, explorer, analyzer and documentation viewer for .NET. Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL."

12) GhostDoc - "GhostDoc is a free add-in for Visual Studio that automatically generates XML documentation comments for C#. Either by using existing documentation inherited from base classes or implemented interfaces, or by deducing comments from name and type of e.g. methods, properties or parameters."

13) DPack - "DPack is designed to greatly increase developer's productivity, automate repetitive processes and expand upon some of the Microsoft Visual Studio features. DPack includes various browser tools that allow the developer to quickly narrow the search down to a particular class, method or assembly type. DPack includes greatly enhanced numbered bookmarks feature, various code navigation tools as well as streamlined surround with feature, and much more."

14) CodeKeep - "With the CodeKeep add-in, you can manage your code snippets and search for other code snippets without ever having to leave Visual Studio."

15) AnkhSVN - "AnkhSVN is an open-source Visual Studio .NET addin for the Subversion version control system. It allows you to perform the most common version control operations directly from inside the VS.NET IDE. Not all the functionality provided by SVN is (yet) supported, but the majority of operations that support the daily workflow are implemented."

16) VSCmdShell - "The VSCmdShell powertoy combines the command window and the command prompt and makes them available in a single window. Just about anything you can do in the command prompt you can now do right inside of the IDE. You can also execute Visual Studio commands in the same window by simply prefacing that command with an exclamation point, you will even get IntelliSense for the command list. "

17) Regionerate - "Regionerate is an open-source tool for developers and team leaders that allows you to automatically apply layout rules on C# code. Regionerate runs on Visual Studio 2005, Visual Studio Codename Orcas Beta 1, #develop 2.0, NAnt and on command line."

18) Consolas Font Pack for VS 2005 - "The Microsoft Consolas Font Family is a set of highly legible fonts designed for ClearType. It is intended for use in programming environments and other circumstances where a monospaced font is specified. This installation package will set the default font for Visual Studio to Consolas."

Tuesday, July 17, 2007

Can i manage Digital Assets (like media, artworks, logos etc) using MOSS 2007?

MOSS 2007 offers a rich platform to manage your digital assets. Microsoft's collaborative media management solution, named "Microsoft Interactive Media Manager", extends Microsoft Office SharePoint® Server 2007 for media and entertainment companies. The solution builds on existing technology investments, and helps companies create an end-to-end content production system accessible by everyone. In addition, Interactive Media Manager easily integrates with Microsoft business intelligence tools, giving management insight into production details. Check this article out from Microsoft to find out more

Friday, July 13, 2007

Sunday, July 01, 2007

Enterprise Single Sign On with MOSS 2007

Microsoft Office SharePoint Server enables enterprises to develop an intelligent portal that seamlessly connects users, teams, and knowledge so that people can take advantage of relevant information across business processes to help them work more efficiently. Microsoft Windows SharePoint Services v3 and MOSS 2007 have become very popular in recent years and have helped many businesses create an infrastructure for sharing and collaborating internal information. Read this article to find out more about how SharePoint SSO can be deployed across your enterprise.

Wednesday, June 20, 2007

Microsoft releases Acropolis for .NET Developers

Microsoft has released a set of components and other tools for the development of client applications in the .NET Framework. The product, code-named Acropolis, was announced at Tech Ed 2007 and is available as a CTP, or community technical preview, from the new WindowsClient.NET page.

Acropolis is part of the '.NET Client Futures' wave of releases, Microsoft's preview of upcoming technologies for Windows client development. With Acropolis, developers can create a set of modules and build them into a business application. These modules can be hosted within the Microsoft Office 2007 suite or as stand-alone applications. Built-in themes are available, but customization using XAML is also possible.

The product caters primarily to Windows Presentation Foundation development. Check this awesome blog on some common Acropolis questions. Acropolis CTP seems like a very finished product even in this preview. It integrates nicely into the Visual Studio "Orcas" preview. There are some really cool controls to explore in the toolbox. These controls include single and multipart navigation managers, components for providing, updating and publishing data, and several UI controls.

Agile Development Methodologies

Agile software development is picking up steam. You have most likely heard about eXtreme Programming (XP). What other Agile methodologies are you familiar with and what do they bring of interest or significance to the table of agility? More important, why should you learn about these different methodologies instead of simply focusing on one?

No one shoe fits all. Any methodology that requires you to follow it in totality and not let you adapt is rather dogmatic, not pragmatic. To be effective we have to take the best of different approaches and apply to our projects based on our specific needs.

Click here to listen to an awesome Podcast on Agile Development methodologies

Sliverlight Learning Guide

Silverlight is Microsoft's framework for building cross-browser and cross-platform rich Internet applications with streaming video, rich text, Ajax functionality and the like. Silverlight 1.1 Alpha also includes a slimmed-down version of the .NET Framework Common Language Runtime and supports Microsoft's new Dynamic Language Runtime. This means developers can build Web applications in familiar languages like Visual Basic and C# and in dynamic languages like IronPython and IronRuby.

Five Windows Vista security tips .NET developers should know

A must read if you are writing applications for Windows Vista

Tuesday, June 19, 2007

I've linked a SharePoint list to Microsoft Office Outlook 2007 but I don't see any updates when I view the list in Outlook

With both Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007, the ability to link SharePoint lists and document libraries to Outlook 2007 is a fantastic feature. It lets you take this information offline and synchronize it back to SharePoint at a later time. If you move or delete the linked list or document Library in SharePoint (which is likely what happened in your case), the link in Outlook 2007 isn't automatically updated; you'll need to update it manually. To do so, you need to delete the link in Outlook, then reattach it if so desired. To delete a link to a SharePoint list or document library in Outlook, locate it in the left vertical folder structure, right-click to open the context menu, and click Delete.

Saturday, May 19, 2007

SQL Server “Katmai” to Ship in 2008

The next version of Microsoft SQL Server, which is code-named Katmai, is expected to ship in 2008. Apparently, WinFS (a file storage system) might ship as part of this release. Other things on the vaporware docket include intrinsic support for storing media and other binary formats, better office integration and “more BI thingies.”

Monday, May 14, 2007

CAML query Builder

Chek Patrick Tisseghem's really cool CAML query Builder, free to download for everyone from here

Microsoft APAC SharePoint Conference May 14th - 16th 2007

I am presenting couple of sessions "ARC08 SharePoint Collaboration and Community Tools Tracking, Blogs, Wikis, and More" and "CAB02 Extending MOSS 2007 community features for online websites featuring Hothouse and Mytalk com au" at the Microsoft APAC SharePoint Conference at the Hilton, Sydney Australia. If you are attending this event, please make sure you come along to my session to learn about some cool community feature enhancements we've implemented for this website

Friday, May 04, 2007

Denying access to logged in users (website using forms authentication) to the "_layouts" folder for MOSS websites

You can very easily deny access to all logged in users, to the "_layouts" folder on MOSS 2007 enabled websites by modifying the web.config file and including the following under node:

Tuesday, May 01, 2007

I want to eliminate duplicate documents by creating a link in one document library to a document that exists in another document library. How?

I'm glad this question was asked because the answer is a definite yes. One of the new features in Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 is the ability to extend a document library to support multiple content types. (Content types are groups of settings that you can apply to a category of SharePoint content to help you organize content in a more meaningful way.) One of the built-in content types is Link to a Document. This content type lets you store a title and URL to an existing document in either that document library or a different one.

When you select Link to a Document, you're presented with the appropriate fields to enter the document name and location (URL). After you create a link to another document, the document name will be displayed in your document library and identified with the link icon. You can now access the linked document from this document library.

Microsoft Silverlight goes live

Microsoft's answer to Flash :)
Check this out

Sunday, April 29, 2007

I've been asked to display the currently logged-on user on the home page of our SharePoint Portal. How can I do this?

Surprisingly, this functionality wasn't a standard UI element in Windows SharePoint Services 2.0 or Microsoft SharePoint Portal Server 2003. Rest assured that Microsoft has added it Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007, but if you're still running the earlier versions, there are a couple of methods you can use to gain this functionality. Probably the easiest approach is to find a third-party Web Part that will display this information. You can download one such free Web Part from the Microsoft SharePoint Products and Technologies Web Component Directory at

Another approach, which is described on the MSDN FrontPoint blog in the post "Howto: Display the Username for the Logged on user on a page,", uses the Data View Web Part and a few custom Collaborative Application Markup Language (CAML) techniques. Take a look at the article before you decide on the approach you want to take

Thursday, April 26, 2007

A link to my fellow Blogger

Hi All, You can check my fellow Blogger's blog at Ehsan is an expert in MOSS 2007 and .NET 2.0 Framework

Tuesday, April 24, 2007

Updating SPListItem fields in the ItemAdded event or ItemUpdated event does not actually update the ListItem being updated

One common problems which lot of MOSS developers working on custom event handlers face is that their custom events like "ItemAdded" or "ItemUpdated" etc has code updating the various fields in the ListItem but after the "Update()" method is invoked, the new values are not updated in the ListItem. For example:

public override void ItemUpdated(SPItemEventProperties properties)
SPListItem curListItem = properties.ListItem;
curListItem["Title"] = "Test";

curListItem.DisableEventFiring(); // Disables event firing temporarily before performing update

curListItem.Update(); // This line should update the ListItem but it doesnt

curListItem.EnableEventFiring(); // Enables event firing once update is complete

For the update to go through, its mandatory to set "AllowUnsafeUpdates" property of the Web object with the SPListItem class to true. So the correct version of the above code is as follows:

public override void ItemUpdated(SPItemEventProperties properties)
SPListItem curListItem = properties.ListItem;

curListItem.Web.AllowUnsafeUpdates = true; // This property should be set to true for the update to go through

curListItem["Title"] = "Test";

curListItem.DisableEventFiring(); // Disables event firing temporarily before performing update

curListItem.Update(); // This line should update the ListItem but it doesnt

curListItem.EnableEventFiring(); // Enables event firing once update is complete

How to stop SpListItem.Update() method from recursively calling the ItemUpdated() event handler

When updating a SharePoint 2007 List Item within a custom event handler "ItemUpdated", we need to invoke the Update() method of the ListItem to commit changes to the MOSS DB. However when you invoked the Update() method within the "ItemUpdated" event handler, it triggers a recursive loop and keeps triggering the event again and again. For example:

public override void ItemUpdated(SPItemEventProperties properties)
SPListItem curListItem = properties.ListItem;
curListItem["Title"] = "Test";

curListItem.Update(); // This line triggers the event to fire again recursively


A possible solution is to use the Enable/Disable Event Firing methods available on the SPListItem object. For example:

public override void ItemUpdated(SPItemEventProperties properties)
SPListItem curListItem = properties.ListItem;
curListItem["Title"] = "Test";

curListItem.DisableEventFiring(); // Disables event firing temporarily before performing update

curListItem.Update(); // This line triggers the event to fire again recursively

curListItem.EnableEventFiring(); // Enables event firing once update is complete

Monday, April 23, 2007

Common Search Crawler GOTCHAS - Crawler complains "Access Denied" as WSS site has form authentication enabled

Many people experience the search not working on a SharePoint team with form authentication enabled. The common reason is that they do not have an extended web application (sharing the same content as the parent web application) on a different zone with NTLM/Windows Integrated authentication. The search crawler accesses to site content with NTLM account. It will get an Access Denied error when accessing to the form-authentication site. If you only use the windows Integrated authentication but still get one of the following errors, please make sure that your Content Access Account has enough (Full Read) privileges on the WSS sites. (Please see our "Grant Permission" section and select the web application using windows integrated authentication)


  • (Link does not work and is used for illustration purpose only)
  • Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content. (The item was deleted because it was either not found or the crawler was denied access to it.)

Therefore, you will need a new web application with the same site content as the form-auth site and with the NTLM authentication enabled. How can you do it? You can use the SharePoint feature, "Extend an existing web application". Please follow the steps as below to extend a web application.

Extend the web application

  1. Extend the form-authenticiation web application to a zone with windows-integrated authentication (NTLM) enabled
  2. Go to Central Administration > Application Management page
  3. Click Create or Extend web application and select Extend an existing web application
  4. Make sure if the web application field shows the one you have set up the form authentication. If not, click on the drop down menu and select the web application in a popup dialog, e.g. SharePoint - 80
  5. Either choose to use the randomly-generated port or assign a port. (The extended web application will be located at this port and share the same content as the original web application)
  6. Select NTLM
  7. Select No for Allow Anonymous option
  8. Choose a zone (e.g. custom)
  9. Click OK
  10. After the web app is extended, the page will be redirected to the central administration page.
  11. To test the site, please access to the extended web application and log on to the site with your search crawl acount.

Grant Permission

Please make sure if the search crawl account has access to the new web application. If not, please follow these steps to grant permission

  1. Go to Central Administration > Application Management page
  2. Click on Policy for web application
  3. Click on Add Users
  4. Make sure if the web application field shows the one you have set up the form authentication.
  5. Select the zone that you extended the web application (e.g. custom)
  6. Click Next
  7. Enter the crawl account username to Users field
  8. Check Full Read for the permission
  9. Click Finish
  10. To test the site, please access to the extended web application and log on to the site with your search crawl acount.

In the next crawl, the crawler will access to the site content through this “secret” NTLM web application. It will be able to get the form authentication descriptor of the content. After the crawl’s completed, you will see search results in your form-authentication site. It’s important to know that the URL of search hit will be based on your form-authentication site, because it’s depending on where you are searching from.

(Thanks to the great tips offered by wsssearch website. You can find more information about this website here)

Saturday, April 21, 2007

Reach me on LinkedIn Network

I have been asked repeatedly by lots of people to connect through on my LinkedIn Network. You sure can now. Just send me a LinkedIn invite to "h i _ r a g s @ h o t m a i l . c o m" (just remove spaces between the alphabets in the above email address before you use it to send me your LinkedIn invite). Looking forward to connect with you.....

Using ASP.Net user controls in your WSSV3/MOSS ASPX pages

Following on from Chris Johnson's post of application dev on SharePoint (here), I have had some people ask how to embed ASP.Net User Controls in the pages you can add to your site using Option 4 (see post for more details on what this option is).

Well ... i did some digging/research and have this set of steps to achieve this. Here goes:

1. Create a Directory called "usercontrols" in the root of your sharepoint web site on the file system E.g. C:\Inetpub\wwwroot\wss\VirtualDirectories\moss.litwareinc.com80\UserControls

2. Open IIS manager and in the root of your SharePoint site create a VirtualDirectory called "_controls" and point it to that newly created directory.

3. Put your user control in that newly created directory on the filesystem

4. Open the web.config file and add the following:

5. In your ASPX page add the following:
<%@ Register src="~/_controls/SomeControl.ascx" mce_src="~/_controls/SomeControl.ascx" TagName="somecontrol" TagPrefix="uc2" %>

6. Run your ASPX page and your control should render correctly.

View Complete article...

Toggle of Anonymous access fixed for MOSS 2007 sites

And I only had to do it at the site collection level (site settings -> advanced permissions) and NOT the web application (central admin -> application management -> authentication provider) level

What I did :

Make sure the viewformpageslockdown feature is enabled on the site
Navigate to the top level site collection’s root web Site Settings
Click the Advanced permissions link under the Users and Permissions section
Now under the settings menu, select anonymous access
Set Anonymous users can access to Nothing

Then step through the process again and re-enable anonymous access by setting anonymous access to Entire Web site.

And it works !!!

So now (for illustration only as link is not active) returns a 401 UNAUTHORIZED and the website is now secured as it should be.

And all it required was a toggle of anonymous access for the viewformpageslockdown feature to kick-in.

Custom help window can be opened by hacking into the Core.js file in MOSS 2007

I have been asked a few times about popping a custom help window (as opposed to a SharePoint Help window) while clicking on context sensitive help links on MOSS sites. This can be easily done by changing the "Core.js" file which can be found at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\Core.js" on your MOSS web server. Once you locate the file, find the Javascript function "HelpWindowHelper()" and change it to suite your requirements. An example is provided below:

function HelpWindowHelper(strParam)
var strHelpUrl;

if (typeof(strParam)=="undefined")
else if (strParam == "&Key=Custom") /* Present new Custom Help Windows when parameter is 'Custom' */
var, "STSHELP",

Please note that this change should be tracked and documented as its a unsupported hack for future Service Pack releases of MOSS 2007 (as SPs might overwrite "Core.js" with its own new version, in which case you will loose your changes if you havent documented them)

How to register your custom events in MOSS 2007

You can register your custom MOSS event handlers using a few techniques. I have always been a fan of a simple Console application which will do the trick. The pre-requisites are:
1) Ensure that the assembly implementing the custom event handlers in strongly typed (i.e., should be signed with your private key - Click here to learn how to do this...)
2) Ensure that your custom event handlers strongly typed assembly has been registered in the GAC of the server (or on each server on a web farm).

Once you have checked the pre-requisites you can write a Console application to do your job. An example is as below:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace RagavWebsite.Website.RegisterEventHandlers
// Console application to register custom event handlers on a specific list called "Comments" on the website
class Program
static void Main(string[] args)
SPSite curSite = new SPSite("http://RagavWebsite/sites/Vowel/RagavBlog");
SPWeb curWeb = curSite.OpenWeb();

SPList commentsList = curWeb.Lists["Comments"];

string asmName = "RagavWebsite.WebSite.EventHandler, Version=, Culture=neutral, PublicKeyToken=682fb345e6f432a";
string className = "RagavWebsite.WebSite.EventHandler.RagavWebsiteVowelCheckItemHandler";

commentsList.EventReceivers.Add(SPEventReceiverType.ItemAdding, asmName, className);
commentsList.EventReceivers.Add(SPEventReceiverType.ItemUpdating, asmName, className);

ItemAdded event handler vs. ItemAdding event handler

I often get asked this question when should i use the ItemAdded / ItemAdding event handler in MOSS 2007. Well the answer is really simple. If you are adding an item to a list and want to perform a set of actions before the item is saved, including preventing the item from being saved or throw an exception, "ItemAdding" is the event handler to override. If you want to perform post add actions then "ItemAdded" in the event handler to override.

Also note that in your event handler code, you would need to use the "AfterProperties" bag to read the list field values that have changed (as opposed to the "Properties" bag). For example:

private void VowelCheck(SPItemEventProperties properties)
string vowelErrorMessage = string.Empty;
// Check whether the Title field exists within the List
if (properties.AfterProperties["Title"] != null)
// Assumption that you have a class called VowelListManager.cs which has a function CheckVowelExists()
vowelErrorMessage = VowelListManager.CheckVowelExists(properties.AfterProperties["Title"].ToString());

// If Error Message is returned then the current words has failed the vowel test- This code also shows how to cancel a SharePoint event (like stop the item from being added or updated)
if (!vowelErrorMessage.Equals(string.Empty))
properties.ErrorMessage = vowelErrorMessage;
properties.Cancel = true;

SharePoint Tips and Tricks

While working on SharePoint projects, i have often tumbled across these common issues:
1) Masking the user’s email and other details.
2) The restrictive read access for lists that would prevent anonymous users to see the all items page but it will allow a webpart running in anonymous context to read the list items.

A possible solution for this is as follows:

1) User email details – disable the page – add a webpart or a handler that redirects the req. (this is my understanding of the only way this can be done)
2) Restrictive read – make sure you used the publishing template and make sure this is active:

Use lockdown mode:
Lockdown mode is a feature that you can use to secure published sites. When lockdown mode is turned on, fine-grain permissions for the limited access permission level are reduced. The following table details the default permissions of the limited access permission level and the reduced permissions when lockdown mode is turned on - Read more here...