Galin Iliev's blog

Software Architecture & Development

Power "toys" for VS 2008 DB Edition

A new set of tools has been released for Microsoft Visual Studio Team System 2008 Database Edition. This is a set of tools that enable you to create unit tests against database.

According the download site here is what's included in these tools :

This release updates the Power Tools for the Database Edition to work with Visual Studio 2008 and provides several new features. The new features include two custom unit test conditions, a new Data Generation Wizard, and new MSBuild tasks to support running TSQL Static Code Analysis from the command line. The updated features include 5 refactoring types, a dependency viewer, additional data generators and editors, 2 MSBuild tasks for Schema and Data Compare and the TSQL Static Code Analysis feature

New Test Conditions for Database Unit Tests
• ChecksumCondition – You can use this test condition to verify that the checksum of the data set returned by a database unit test matches the checksum of an expected data set.
• ExpectedSchemaTestCondition – You can use this test condition to verify that the column names and data types of the returned data set match expected values.

Data Generator Improvements
• New Data Generator Wizard – This new wizard creates a data generation plan that is configured to copy data from a source database. You can use this wizard when you need to copy most of your data from a live source, but need to make small changes to ensure privacy.

MSBuild Task Improvements
• SqlAnalysis Task – You can use this build task to run T-SQL Static Code Analysis from MSBuild.
TSQL Static Code Analysis
• Static Code Analysis - A precursor to the functionality that will be in future versions of VSTS that will allow you to perform Static Code Analysis on T-SQL code.

Refactoring
• “Move Schema” Refactoring - Allows a user to right click on an object and move it to a different but existing schema
• SP Rename Generation - Generate a new script that will contain sp_renames for all rename refactored objects that the user can then execute.
• Wildcard Expansion - Automatically expand the wildcard in a select to the appropriate columns.
• Fully-Qualified Name Support - Automatically inject fully-qualified names when absent in a script
• Refactoring extended to Dataset - Refactor into strongly typed dataset definitions

MSBuild Tasks
• Data / Schema Compare Build Tasks - MSBuild tasks that can generate scripts as if the user had run the Data / Schema compare UI

Schema View
• API Access to Schema View - Insert / Update / Delete to schema View and list schema objects and their associated files

Dependency Tool Window
• Dependency Tree - Show the dependencies ( incoming / outgoing ) for selected schema objects in a new tool window

Miscellaneous Tools
• Script Preprocessor - Expand SQLCMD variables and include files and command line version (sqlspp.exe) & an MSBuild version ( wraps the command line version )

Grab it from here.

Well Gert posted a good walkthrough in screenshots showing how new Data generation wizard works.

What to expect form Microsoft in 2008?

I Bink.nu makes a guess what is coming out from Microsoft in 2008.

Windows

"Windows Server 2008 Standard" Edition (x64, with Hyper-V)
"Windows Server 2008 Enterprise" Edition (x64, with Hyper-V)
"Windows Server 2008 Datacenter" Edition (x64, with Hyper-V)
"Windows Web Server 2008" Edition (x86 and x64)
"Windows Storage Server 2008" Standard Edition (x86 and x64)
"Windows Storage Server 2008" Express Edition (x86 and x64)
"Windows Unfified Data Storage Server 2008" Edition (x86 and x64)
"Windows Small Business Server 2008" (Codenamed "Cougar") (x64) for small businesses
"Windows Essential Business Server 2008" (Codenamed "Centro") (x86-64) for medium-sized businesses
"Windows Server 2008 for Itanium-based Systems" (IA-64) (same features as Datacenter Edition)
"Windows Server 2008 Standard without Hyper-V" Edition (x86 and x64)
"Windows Server 2008 Enterprise without Hyper-V" Edition (x86 and x64)
"Windows Server 2008 Datacenter without Hyper-V" Edition (x64)
"Windows HPC Server 2008" (High Performance Computing, previously Compute Cluster Server)
Most editions support "core" installations

Windows 2008 Hyper-V stand alone SKU

"Windows Home Server R2" (based on 2008? Dont think so)
Windows Server 2008 R2/Update Release (beta)

"Windows mobile 6.1" Q1 2008
"Windows mobile 6.1 Professional" q1 2008
"Windows mobile 7" RTM Q4 2008 (First phones in 2009, just 1 edition!)
"Windows CE" 7 ?
"Windows Mobile for Automotive" 6.0? -> "Microsoft Auto" 2.0?

Windows Vista Service Pack 1
Windows Vista for Embedded Systems
Windows Vista Media Center Update (Fiji) I expect at least a beta
Windows Vista Ultimate Extra's ....
Windows Steady State 2.5

Windows XP Service Pack 3

Windows 7 Beta (Codename Vienna)
MinWin beta (Windows 7 kernel based mini OS)

Internet Explorer 8! (Beta 1st half 2008)

Servers

SQL Server 2008 standard Edition
SQL Server 2008 Enterprise Edition
SQL Server 2008 Express Edition
SQL Server 2008 Workgroup Edition
SQL Server 2008 Developer Edition
SQL Server 2008 Compact Edition?

ISA Server 2008 standard Edition x64
ISA Server 2008 Enterprise Edition x64

Biztalk Server 2008 Enterprise Edition
Biztalk Server 2008 Standard Edition
Biztalk Server 2008 Branch Edition
Biztalk Server 2008 Developer Edition

Search Server 2008 (standard Edition)
Search Server 2008 Express Edition

WSUS 3.0 SP1

Exchange 2007 Service Pack 2 beta, maybe but expect the regular roll-up packs

Finaly a new Microsoft Identity and Integration Server?

Host Integration Server 2008 ?

Commerce Server 2007 R2 ?

Forefront
Intelligent Application Gateway 2007 R2?
Microsoft Forefront codename “Stirling” Beta
ForeFront for Exchange "14" Beta
ForeFront for SharePoint "14" Beta
Security Management Console
Security for Office Communicator

System Center

Service Manager 2008 (beta, RTM Q1 2009)
Mobile Device Manager 2008
Capacity Planner 2007 with sharepoint 2007 support
Application Virtualization 4.5 (softgrid)
Desktop Optimization Pack for Software Assurance
Diagnostic and Recovery Toolset 6.0 (DaRT)
Operations Manager 2007 SP1 (Q1)
Operations Manager 2007 R2 (beta)
Configuration Manager SP1 (H2)
Configuration Manager 2007 R2
Virtual Machine Manager 2008 R2
Identity LifeCycle Manager
System Center Essentials v2
System Center Online Services

"Microsoft Deployment" Solution Accelorator update for WS08 RTM

Office

Office 14 Beta ?
Office Live Workspace launch
Office Communicator Webclient

Dynamics

CRM 4.0 general availability (it just RTM'd)
Point of Sale 2.0 sp1

Consumer

Encarta 2009
Money 2009
Streets and Trips 2009

Hardware

Probably new mice ;-)
Zune firmware 2.x
Zune Phone?

Xbox

HD Video for Europe
IPTV Service

Windows Live

Windows Live Messenger 9.0
Windows Live SkyDrive
Windows Live Calendar
Web Windows Live Messenger

Visual FoxPro
Visual FoxPro version 9 service pack 2 is last that was released for this product (oct 2007), no Foxpro 10, version 9 is end of life in 2015
Visual Studio

Visual Studio 2008 SP1 ?
Silverlight 2.0
Tafiti
PopFly

Expression

Expression Blend 2

MAC

Office 2008
Messenger

Other Stuff

Media Room
Tellme

 

Pretty impressive...

Data Mining with MS SQL Server

 


Rafal Lukawiecki
A few weeks ago I attended to a very nice seminar organized by Microsoft Bulgaria about Data Mining. We enjoyed a full day with leading world-class strategic consultant Rafal Lukawiecki. It was a nice catch-up and deep dive into Data Mining and Business Intelligence- BI. According Rafal Data Mining will be very fast-growing area in next 5-10 years.
This seminar will be recorded in May 2008 on MS Technet

 

Here is a video talking about it:

 

Interested?! Here is an article how to start Data Mining with SQL 2005 and MS Office 2007.

WebResource.axd reported Error 404, images - 403.1 - Forbidden

Recently I had interesting experience with web applications that deserves a blog post. We decided to run broken link checker on huge ASP.NET site on staging server (Win 2003 & IIS6). This could also act as a small load test.

So far so good but I've noticed two main reports:

  • WebResource.axd with one specific parameter reported Error 404.0 - File not found
  • some requests to images (.gif) reported Error 403.1 - Forbidden

These errors are logged on IIS log. 

This is quite strange because when I try to run them in the browser manually everything is fine. The hardware seems not very loaded.

 

While investigating it further (and getting a clue from IIS.NET Forums) I got that IIS is actually trying to executed .gif files (See IIS Status codes). Probably same happens to WebResource.axd...

Then I went on link checker side and noted that it makes "HEAD" request (point 9.4) in order to reduce traffic.

 

I wrote this little tool to check my assumption.

1: using System;
2: using System.Net;
3: using System.Threading;
4:  
5: namespace UrlChecker {
6:     class Program {
7:         static string URL_TO_CHECK2 = "http://localhost/WebResource.axd?d=long-param-here";
8:         static string URL_TO_CHECK = "http://localhost/Photo/1116.gif";
9:         static int LOOPS_NUM = 10;
10:         static int THREADS_NUM = 10;
11:         static int REQUEST_TIMEOUT = 10000;
12:         static string REQUEST_METHOD = "HEAD"; // or "GET"
13:  
14:  
15:         static ManualResetEvent sync = null;
16:         static void Main(string[] args) {
17:             sync = new ManualResetEvent(false);
18:             Thread[] threads = new Thread[THREADS_NUM];
19:             for (int i = 0; i < THREADS_NUM; i++) {
20:                 threads[i] = new Thread(new ParameterizedThreadStart(CheckLink));
21:                 threads[i].Start(i);
22:             }
23:             sync.Set();
24:             Console.Write("Press 'Enter' to exit!");
25:             Console.ReadLine();
26:         }
27:  
28:         static void CheckLink(object ThreadId) {
29:             sync.WaitOne();
30:  
31:             for (int i = 0; i < LOOPS_NUM; i++) {
32:                 string statusCode;
33:                 try {
34:                     HttpWebRequest rq = (HttpWebRequest)WebRequest.Create(URL_TO_CHECK);
35:                     rq.Method = REQUEST_METHOD;
36:                     rq.Timeout = REQUEST_TIMEOUT;
37:                     HttpWebResponse resp = (HttpWebResponse)rq.GetResponse();
38:                     statusCode = resp.StatusCode.ToString();
39:                 } catch (WebException ex) {
40:                     statusCode = string.Format("Exception: {0}", ex.Message);
41:                 }
42:                 Console.WriteLine("{0} - '{1}'", ThreadId, statusCode);
43:             }
44:             Console.WriteLine("Thread {0} finished.", ThreadId);
45:         }
46:     }
47: }

And this helped me to confirm it..   Note on line 12 is set HEAD request and all requests fails with the messages shown above (404 and 403.1 accordingly). When GET request is used everything is OK. Luckily the link checker supported GET request on failed although I had some difficulties setting it.

LINQ to SQL vs LINQ to Entities

Elisa Flasko from Microsoft Data Platform Team wrote a nice article "Introducing LINQ to Relational Data" highlighting main features or two main ORMs coming out form Microsoft with Visual Studio 2008 (ADO.NET EF is not released so far but it will be released as additional package to VS2008)

In short:

LINQ to SQL is applicable when:

  • Use an ORM solution and my database is 1:1 with my object model
  • Use an ORM solution with inheritance hierarchies that are stored in a single table
  • Use my own plain CLR classes instead of using generated classes or deriving from a base class or implementing an interface
  • Leverage LINQ as the way I write queries
  • Use an ORM but I want something that is very performant and where I can optimize performance through stored procedures and compiled queries

LINQ to Entities is applicable when:

Write applications that can target different database engines in addition to Microsoft SQL Server

Define domain models for my application and use these as the basis for my persistence layer.

Use an ORM solution where my classes may be 1:1 with the database or may have a very different structure from the database schema

Use an ORM solution with inheritance hierarchies that may have alternative storage schemes (single table for the hierarchy, single table for each class, single table for all data related to specific type)

Leverage LINQ as the way I write queries and have the query work in a database vendor agnostic manner.

Use an ORM but I want something that is very performant and where I can optimize performance through stored procedures and compiled queries

 

Read article on MSDN or download Word 2007 version.

Microsoft's $44.6B offer to buy Yahoo

The news is everywhere this morning about Microsoft's $44.6B offer to buy Yahoo. The offer represents $31 a share, a 62% premium over Thursday's closing price; and Yahoo's stock price has been rising in after-hours trading. Microsoft has been making overtures to Yahoo since 2006, according to the CNet article, including a buyout offer last February that was rebuffed. Mediapost.com has some perspective on the deal from the point of view of ads and eyeballs. Such an acquisition, which would be Microsoft's largest by far — it bought Aquantive last year for $6 billion — would need approval by US and EU authorities. A European Commission spokesman declined to comment.

(via Slashdot)

How to create software/libraries that will be used?!

We, the devs, like to create software - there is no doubt in this. We put our hearts, our souls in it. That's why we are much more productive when we work on something we really like. And when our creature has success - it is wide used by users - we feel great - this is a great reward for long hours spent in front of the screen :) . But can we know if the piece of the code will be wide used?!

The answer is YES. By simply following this mind flow:

So, does this work? It does, but it is cumbersome to write. And if it is too cumbersome, I already know that I'm not going to use it. I might start doing it, but I would soon give up. Are there ways to ease the pain?
Luca Bolognese (Lead Program Manager for the Visual C# team)

Yes, I know some things cannot be simple :) But this doesn't mean we cannot try to make them simpler.

 

I remember a short ads... in Discovery channel  "Guess the gadget" in which some very complicated inventions from end of 19th century were shown as they are supposed to ease the life. But they were so complicated so you cannot even guess what they do. (How can you used it as you don't know their main use and just for it you need training :) )

 

So stay with KISS principle or your products won't be used at the end of the day...

 

And as Albert Einstein said "everything should be made as simple as possible, but no simpler" [wikipedia].

Building a Volta Control : A Flickr Widget

Tanzim Saqib wrote a nice article about Microsoft Volta in which he gives step by step instructions on how to write a Flickr control that you can reuse  in your pages.

Microsoft Live Labs Volta is Microsoft's emerging toolset that enables developers to build multi-tier web applications by applying familiar .NET techniques and patterns. The intended use of this toolset is for Developers to build web application as .NET client application, and then specify the portions of the codes that will run on the client and server side. The compiler then creates cross browser JavaScript, Web Services, communication, serialization, security etc. to tie the tiers together. This article is based on the first CTP of Volta considering its current limitations. We will see how we can create a Volta control that the compiler can convert into an AJAX Widget without requiring us writing a single line of JavaScript code. We will write code in our very familiar C# language.

Interesting reading! Full Article.