Wednesday, August 18, 2010

How to upload/download a document in SharePoint 2010 using Client Context Object Model

In order to use ClientContext I need to add reference to two dll’s to my project i.e. Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll.
In this blog I’ll display how to
  • Get ListItemCollection from SharePoint document list using CAML
  • Upload a document to SharePoint Document list
  • Download a document from SharePoint Document list

Get ListItemCollection from SharePoint Document list using CAML:


I can get the ListItemCollection as displayed in code snippets below
ListItemCollection listItems = GetListItemCollectionFromSP("FileLeafRef", documentName, "Text", 1);
The GetListItemCollectionFromSP returns the List item and the parameters to method are
name – Name of the FieldRef, value = value to match for that FieldRef, type – Type of the value and rowLimit – Maximum number of rows to fetch

Monday, August 9, 2010

How to unit test SQL Server 2008 database using Visual Studio 2010 – Part 3

This is the last article of the series “How to unit test SQL Server 2008 database using Visual Studio 2010”. The previous articles are

Unit test SQL Server 2008 - Part 1 – Focused on setting up environment, creating database project and executing simple unit tests

Unit test SQL Server 2008 - Part 2 – Focused on internals of database unit testing i.e. assemblies

I’ll divide this article into two logical parts

  • Tools that are useful for creation of test data as well as ensuring that database schemas are synchronized

    • Data generation

    • Schema comparison

    • Data comparison


  • More about unit testing a database which include

    • Data driven unit tests

    • Pre, test and post scripts

    • Test conditions

    • Transactions


Saturday, August 7, 2010

How to unit test SQL Server 2008 database using Visual Studio 2010 – Part 2

This is the second article I am writing on unit testing SQL Server 2008 database using Visual Studio 2010.  The other articles are

Unit test SQL Server 2008 - Part 1 – Focused on setting up environment, creating database project and executing simple unit tests

Unit test SQL Server 2008 - Part 3 – Focused on data generation, schema comparison, data comparison and data driven unit tests

In this article I will explore the important features that can be configured to build comprehensive database unit tests. The two assemblies that are the backbone for database unit testing are

  • Microsoft.VisualStudio.QualityTools.UnitTestFramework: This assembly is the testing framework assembly the test engine depends on when executing the unit tests. I won’t get into details of the parts of this assembly and focus on some the the important attributes that are required to execute an database unit test.

  • Microsoft.Data.Schema.UnitTesting: This assembly provides the classes required to create and execute database unit test. In this blog I’ll focus on this assembly.

In this article I’ll dig deep into these two assemblies and explore the various components of these assemblies that are used to execute unit test for a database.

I’ll start with the Database Unit Test Designer and then move on to explaining various components.