Saturday, February 16, 2008

LINQ in Action: Book Review

LINQ in Action Recently I got a copy of the book "LINQ in Action" (by Fabrice Marguerie, Steve Eichert, Jim Wooley, and Matt Warren (Foreword))from Manning publishing. Language Integrated Query (LINQ) is a great feature and I wrote about it in this blog.

The book targets the .NET developers who know C# (2.0) or VB.NET (8.0): Whether you don't know LINQ or you already know - this book is for you. Read it!

For me, it was a pleasure to read it: smooth, clear, didactic and effective.

The book divided into 4 parts:

Getting started, Querying objects in memory, Querying relational data, Manipulating XML and LINQing it all together. The book starts out with a brief of LINQ and then covers the main language enhancements of C# 3.0 and VB.NET 9.0 including: Implicitly typed local variables, Object initializers, Lambda expressions, Extension methods, and Anonymous types. This is a great overview of the features!  There is also introduction covering the history of LINQ, which also presents all the problems that LINQ solves and the design goals of LINQ.

One of the things I really like in this book is that the book doesn't just focus on LINQ to SQL. If you want to know where LINQ is required - read this book. Also, if you want deep dive into LINQ's core - this book is for you. The great thing of this book: It'll satisfy all developers spectrum. One of my favorites chapters in the book is the explanations about extending LINQ.

I think that the last part of the book: LINQing it all together is the best part. It's a great summary for a great book.

The book absolutely helps you and motivate you to use the technology on your next project.

To summarize: for me, this is the only required book for learning LINQ. if you want to know LINQ and love it, you must read this book!!!

LINQ in Action - 5 stars in Maor's index.

Friday, February 15, 2008

Visual Studio Team System 2008 Database Edition Power Tools

Finally, the “DataDude” team announced the availability of the Power Tools for Visual Studio Team System 2008 Database Edition.

The release includes all the functionality that shipped in 2005 plus:

  • Command line SQL Static Code Analysis execution through MSBuild. This enables SQL Static Code Analysis to be an integrated part of Team Build!
  • Data Generation Wizard; allow users to create a new data generation plan by pointing at an existing database, the plan will be fully configured by the wizard to pull all data from the database using the Sequential Databound Generator. This way users can use an existing data set and only override columns which impose risks because of for example privacy concerns and save about half a day or more of configuring a data generation plan from scratch, one column at the time.
  • File based data generator; this allows you to insert the content of files in to the database (works for string and binary, not for XML yet).
  • XML based data generator; this allows you to generate XML based on an XSD (the XSD has to be provided as file right now, and cannot be selected from database or inherited from the data type).
  • Unique Regular Expression generator; this adds the ability to generator unique values using the RegEx String generator.
  • Refactoring Command Generator has been made available as a MSBuild task for better project build integration so it can be made part of the pre-build and pre-deployment stages in the project. This allows users to automated the results of refactoring to some degree in to the project.
  • Two new test conditions for Database Unit Tests
    • ChecksumCondition – Which you can use to verify that the checksum of the data set returned by a database unit test matches the checksum of an expected data set.
    • ExpectedSchemaTestCondition – Which you use to verify that the column names and data types of the returned data set match expected values.

Download page:
http://www.microsoft.com/downloads/details.aspx?FamilyID=73ba5038-8e37-4c8e-812b-db14ede2c354&displaylang=en

Installer download:
http://download.microsoft.com/download/f/b/8/fb8d1c0d-c0c4-4004-ab86-12396b2a3ee3/VSTSDB2008PT.msi

Documentation download:
http://download.microsoft.com/download/f/b/8/fb8d1c0d-c0c4-4004-ab86-12396b2a3ee3/Power Tools 2008.doc

In the following weeks I'll start to record screencasts and writing some posts about this release.

Enjoy!!

Friday, February 1, 2008

TeamBuild 2008 - SetBuildProperties Task

SetBuildProperties task is one of the new tasks that shipped in Team Build 2008. With this task we can modify properties of a BuildDetail object directly from MSBuild's TfsBuild.proj script.

The SetBuildProperties task is defined in the Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll.

The available properties are:

Property Description
LabelName Specifies the label name.
DropLocation Specifies the drop location. (shared folder to which the build account has read/write privileges)
Quality Specifies the build quality.
TestStatus Specifies the test status. Valid values are Succeeded, Failed, and Unknown.
Status Specifies the build status. Valid values are NotStarted, InProgress, Succeeded, PartiallySucceeded, Failed, and Stopped.
BuildNumber Specifies the build number.
TeamFoundationServerUrl Specifies the Team Foundation Server URL. For example, http://MyServer:8080.
BuildUri Specifies the build URI.
CompilationStatus Specifies the compilation status. Valid values are Succeeded, Failed and Unknown.

Usage:

<SetBuildProperties
BuildNumber="$(BuildNumber)"
BuildUri="$(BuildUri)"
DropLocation="$(DropLocation)" />

Thursday, January 31, 2008

Default Build Quality In Team Foundation Build 2008

I wanted to define my default build quality at one of my Team Build Types in TFS 2008. In Team Build 2005 we could define the default build quality. However, in Team Build 2008, the default build quality notion was removed.

Note: The default value for the build quality of a new build in TFS 2008 is null, not empty string.

So, how can we set the build quality? Use the SetBuildProperties task. Read about it here;

Data Dude: How To Ignore Collation in Schema Compare

Do you want to configure the data dude's schema compare tool to ignore the collation when comparing 2 schemas?

To configure it go to:

Tools > Options > Database Tools > Schema Compare > Ignore Collation Order

Monday, January 21, 2008

How To Create Computed Column In Data Dude

In order to create computed column in data dude you have to define it in the CREATE TABLE command.

Example:

CREATE TABLE [dbo].[Products]
(
ProductId int NOT NULL,
ProductNumber nchar(20) NULL,
ComputedProductNumber AS CASE WHEN ProductNumber
IS NULL THEN CONVERT(nchar(20),ProductId)
ELSE ProductNumber
END
);

Saturday, January 19, 2008

.NET Framework Source Code Available

It's here and you can give it a try now! To step through .NET Framework Source code, here's what you need to do.

  1. Install the Visual Studio 2008 QFE.  This Hotfix just updates a DLL that's part of the Visual Studio debugger that fetches the source files, more details on the download page. (64-bit users: read the description as there is a single manual step for 64-bit)
  2. Go into Tools > Options > Debugging > General and turn off "Enable Just My Code" and turn on "Enable Source Server"
  3. Go to Symbols and add this URL http://referencesource.microsoft.com/symbols and a local cache path. Make sure "search only when symbols are loaded manually" is checked.

That's it.

Great post by Shawn gives you more detail.

Note: This functionality is not available on the Express versions of the Visual Studio 2008 products.